Hi,
Some time ago a friend's friend showed me a sample project to access the tables in MS Access directly through vb code. I couldn't see any ADO control on any of the forms. The ActiveX Objects library was however included in the project references.
I tried to do the same thing on my own with a trial project using the Northwind database, but failed. I get the following error messages: connection is closed or the object is not found or method not found.
I included the following statements like him in the project.
Under General declarations:
[CODE=VB]
Option Explicit
Public conXYZ as ADODB connection
Under Formload:
Private Sub Form_Load()
Set conXYZ = New Connection
conXYZ.CursorLo cation = adUseClient
conXYZ.Open "Driver={Micros oft Access Driver(*.mdb)}; DBQ=C:\Test.mdb ;UID=admin;PWD= testdb;"
End Sub
where test.mdb is a copy I made of of the northwind database.
Unfortunately I have lost touch with the guy. Can any one help?[/CODE]
Some time ago a friend's friend showed me a sample project to access the tables in MS Access directly through vb code. I couldn't see any ADO control on any of the forms. The ActiveX Objects library was however included in the project references.
I tried to do the same thing on my own with a trial project using the Northwind database, but failed. I get the following error messages: connection is closed or the object is not found or method not found.
I included the following statements like him in the project.
Under General declarations:
[CODE=VB]
Option Explicit
Public conXYZ as ADODB connection
Under Formload:
Private Sub Form_Load()
Set conXYZ = New Connection
conXYZ.CursorLo cation = adUseClient
conXYZ.Open "Driver={Micros oft Access Driver(*.mdb)}; DBQ=C:\Test.mdb ;UID=admin;PWD= testdb;"
End Sub
where test.mdb is a copy I made of of the northwind database.
Unfortunately I have lost touch with the guy. Can any one help?[/CODE]
Comment