Error trying to connect to Access DB in VB.Net

  • Thread starter Thread starter Christie
  • Start date Start date
C

Christie

I am writing a VB.NEt application in Visual Studio 2005 that will
automate an Access database. When I try the following

Dim oAccess as Access.Application

I get this error: "Type 'Access.Application' is not defined".

I don't know if I am missing a reference or not. Could someone please
show me the correct way.

I already have the following references in my app:
Microsoft Access 11.0 Obj Library
Microsoft ActiveX Data Objects 2.5 Library
Microsoft DAO 3.6 Obj Library
Microsoft Office 11.0 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3

Thanks
 
Unfortunately I could not replicate this error. Does the error occur
when you build or during runtime? If it builds have you tried stepping
through the code to pinpoint the problem line? Any extra info might
help find the problem. Also, to create an intance of the
Access.Application you need to throw in the "New" keyword. i.e. Dim
oAccess as New Access.Application. Also, what exactly are you trying to
automate? You may not even need to create the Access.Application
object.

Thanks,

Seth
 
Seth..thanks you are right..I did not need to create the
Access.Application object..used an ADODB connectin instead...
 
Back
Top