Creating an Access Object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello I wish to create an Access Object of an already existing Access .mdb
database. Below is how this is done in visual basic 6. Please tell me how to
do this in visual basic.net.

Dim objAccess As Object
Dim strDbPath as string = "C:\MyAccessdb.mdb"

Set objAccess = GetObject(strDbPath, "Access.Application")
 
Hi Geraldine

You need to add a reference in your project of 'Microsoft
Access 10.0 Object Library'.

Then use the following code :
Dim objAcess As New Access.Application
objAcess.Visible = True
objAcess.OpenAccessProject("c:\Northwind.mdb")

Kind Regards
Jorge
-----Original Message-----
Hello I wish to create an Access Object of an already existing Access .mdb
database. Below is how this is done in visual basic 6. Please tell me how to
do this in visual basic.net.

Dim objAccess As Object
Dim strDbPath as string = "C:\MyAccessdb.mdb"

Set objAccess = GetObject
(strDbPath, "Access.Application")
 
Back
Top