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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top