Latest update on July 30, 2020 at 10:43 AM by David Webb .

Programs written in Visual Basic 6.0 can access Microsoft Access 2003 databases. Knowledge of programming elements, such as functions and loops, and knowledge of databases and SQL is required to write effective code in Microsoft Visual Basic to connect to Microsoft Access 2003 databases. The ADODB object can create a connection to Microsoft Access 2003 databases. The database records can be accessed with the ADODBecordset API. The Open() interface is used to create and access the records of the Microsoft Access 2003 database. SQL may be used to perform operations such as searching the database for matching information.

How to Connect VB6 to MS Access 2003

In the General Declaration Area paste this:

Dim cn As New ADODB.Connection

Dim rs As New ADODB.Recordset

(in Form's Activate Event)

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=EMPdb;Persist Security Info=False"

cn.Open

rs.Open "select Eid,Ename,ppfSub,Basic From EmpData Order By Eid", cn, adOpenStatic, adLockPessimistic

Text1ext=rs.Fields(0)

etc

Photo: 123rom

Tags:
Tomasz David
Tomasz David

Leave a Comment