Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Access Database using VB6

Status
Not open for further replies.

JPimp

Technical User
Mar 27, 2007
79
0
0
US
For some reason when I try to connect to this database now, used to work on my other PC, it comes back with this error when I put a "stop" on the line:

Object variable not set or with block variable...

This is the connection command:

cmdLookupMachines.ActiveConnection = "Driver={Microsoft Access Driver (*.mdb)};Dbq=\\servername\share$\Folder name\Database.mdb;"

Why would it not work suddenly? I can connect to the string using a run command from my PC...


Kai-What?
 
Where do you initialize cmdLookupMachines ?

Also, do you have permissions to \\servername\share$\Folder name\

Joe Schwarz
Custom Software Developer
 
Have you at any point prior to that line that is in scope, initialized the object?

Dim cmdLookupMachines As New ADODB.Command

or

Dim cmdLookupMachines as ADODB.Command
Set cmdLookupMachines = NEW ADODB.Command



"If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top