473,238 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

how to connect microsoft access to visual absic 6.0?

does anyone who could help me on how to connect access to visual basic. What control am I going to useed and what is its code????? I'm just only wanted to see the simplest way on how to connect each other. BNecause there is many pages on the internet but doesn't suite or not bnle to run on my program.

Hope that you could help me.
Feb 13 '07 #1
3 4602
Step 1 :
In your project select reference --> microsoft activex data object librery 2.1

step 2 :

******In General _ delcarations write the following code
Public cn As Connection
Public adors As Recordset
Dim Sql As String

step 3 :

*********in form_load event write the following code
Set cn = New ADODB.Connection
cn.Provider = "Microsoft.JET.OLEDB.4.0"
cn.ConnectionString = "d:\vb projects\a.mdb" '(select the proper path)

step 4 :
write query when required
Feb 13 '07 #2

If you want the simplest to just connect to the MS Access database...
YOu can use Data COntrol. It simply bind the database to the control..
I wish i attach file here so that i can give you many codes to do that....

Just so show you simple example:
open vb6
create new project
add controls Tetxbox and Data Control

By default the name of Data Control is Data1.

DO this with data1 properties
Databasename - there is a button that you can click to select your database
Recourdsource-select what table are we going to use

For Example You have a TextBox to display a record then,
from textbox properties:

Datasource=<Select the control> e.g. in our example select the Data1
Datafield-This is where you can select what field from your table you want to display.

try to run the program and check how it works...(F5)
Feb 15 '07 #3

In addition you can also do this on coding using the Data Control.Thats the next step the coding part... I hope i'ved answered/help you...

Feb 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Linda Lee | last post by:
I purchased Visual Basic .NET version 2003 Standard I first try to connect Visual Basic .NET 2003 Standard to SQL Server 2000 Personal edition. When I go into Visual Basic .NET under Server...
by: Dave | last post by:
I am trying to learn .NET with the standard edition of VC++.NET 2003 Standard edition. When I use the wizard in the toolbox to connect to a non-microsoft ODBC data source, I get the error message...
by: http://www.visual-basic-data-mining.net/forum | last post by:
Hi, I am new here. I am facing a problem that I can't connect to MS Access with my Web application written in VB.Net. It gives me this kind of error: The Microsoft Jet database engine cannot...
by: perjorgen | last post by:
Hi, My asp.net can't connect to any sql database when running 1.1 I can connect to databases if I make a windows application and if if I run asp.net 2.0 Other computers have no problem...
by: czi02 | last post by:
ive pt pictures on my microsoft frontpage and how can I connect it to visual basic? And what is its code? I search many websites but I can't find any codes. Would you help me ? About my problem.
by: czi02 | last post by:
Does anybody out there knows how to connect html to visual basic? Ive put pictures on the microsoft frontpage then I don't know how will i hyperlink the picture on the other page? And how will I be...
by: czi02 | last post by:
Hi there;; I had design on frontapge Ive put pictures and hyperlink it. on it.. Then I want it to add on my visual absic 6.0. What is the properties or components am i going to usesd to be able...
by: czi02 | last post by:
How to connect html frontpage to visul basic 6.0?? what properties am I going to used and what is its codes???/?/ I had an microft fdrontapge that had saved on my shared folder. then how am i...
by: czi02 | last post by:
Im just try to go in the html ask a questions because in the visual basic ask a quetion they do not know on how how to connect html to visual basic?? What components am i going to used and what is...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youíll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.