Sie sind auf Seite 1von 10

Connecting VB Application and MS Access In 4 easy Steps

1.

Make a database suitable for your Application

2.

Make ODBC Driver for your database

3.

Add ADODC Control to Your VB Application

4.

Connect your ADODC with the Text Boxes

This is a chain Process, Should be followed one after another


1
Email:varundaga2007@gmail.com

Make a Microsoft Access Database with Required Columns to store Data from your Application and save it.(remember the table name)

2
Go to

Now we have to make ODBC Driver for Database. Follow these Steps.

>

>

>

Now Click on Add Button


2
Email:varundaga2007@gmail.com

Select (*.mdb ,*.accdb) Because we are using MS Access .mdb & .accdb are the Extensions for the Access 2003 and Access 2007 file
** In Windows 7 this option may not be there, Scroll down to last page to see what to do in this situation But the remaining steps are same.

1. Select the Database you made for Application. 2. Give some name for your Database ODBC Driver . (Here apple is our ODBC DriverName) 3. Click OK.
3
Email:varundaga2007@gmail.com

Now we are done with Making ODBC Driver for Our Database.

1. Make a database suitable for your Application 2. Make ODBC Driver for your database 3. Add ADODC Control to Your VB Application

Tasks to be done outside VB

Tasks to be performed inside VB

4. Connect your ADODC with the Text Boxes

Now remaining steps need to be performed inside Visual Basic 6.0

Now Get into Visual Basic Project > Components (Ctrl + T)

Email:varundaga2007@gmail.com

Now Check the Tool Box a new tool is added

Drag and drop this tool into your Form.

Email:varundaga2007@gmail.com

Now connect this Adodc1 with the ODBC Driver we made.


1. Click on Adodc1. 2. Check the Properties of Adodc1 in the Right hand side of Screen.

3. Two Properties of Adodc1 need to Changed ( Connection String & RecordSource ).

Click Here

apple is the name of the ODBC Driver we made. 6


Email:varundaga2007@gmail.com

Our Database is Connected through ODBC Driver and ADODC ,Now we need to Specify the Table name we made in Access, Suppose the table name is Table1 The table name is to specified in the RECORDSOURCE property of Adodc1. 1. Click on Adodc1. 2. Check the Properties of Adodc1 in the Right hand side of Screen.

Click Here

Email:varundaga2007@gmail.com

See the Table names are appearing in the List. Select the required table Means 50% of Connection is Successful.

4
Now our database is indirectly connected to Adodc1

3 1 2

Email:varundaga2007@gmail.com

Now we have connect the text boxes with the Adodc1

1. Select the Text Box 2. Check the Properties of the textbox in the Right hand side. 3. Two Properties to be changed here. ( Data Source and Data Field )

1. DataSource : Adodc name 2. DataField : Column name First set the DataSource name then Datafield

Email:varundaga2007@gmail.com

1.

2.

If your connection is 100% correct then this list of Columns will appear from your table. Assign the Particular Column name to the respective Text Box & thats all, similarly do same thing for the remaining textboxes

-----------------------------END---------------------------ODBC Driver for Windows 7 (32 bit & 64 bit) Follow the following path to get compatible ODBC Driver.
C:\Windows\winsxs\x86_microsoft-windows-m..-odbc-administrator_31bf3856ad364e35_6.1.7600.16385_none_44263d819f0aa19e

Or , Go to

C:\Windows\winsxs and search for file odbcad32 This tutorial assumes Reader have basic Knowledge of VB 6.0 and MS Access For any Feedback / Suggestions / queries or to say Hi mail me at varundaga2007@gmail.com www.facebook.com/varundaga2007

10

Email:varundaga2007@gmail.com

Das könnte Ihnen auch gefallen