ADO connection to MSAccess 2000

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
DingDong
Newbie
Posts: 15
Joined: Tue May 11, 2010 11:28 am
Location: Canada

ADO connection to MSAccess 2000

Post by DingDong » Tue May 11, 2010 11:47 am

Hello,
Register to MS 11. Running it from XP SP2.
I want to connect with ADO to a pw protected MSAccess DB located on the C:\ drive.

I run the following script without success.

Code: Select all

//Connect to Datasource
//
Let>str=Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Desjardins\Suvriq\Repres.mdb;User Id=admin;Password=XGVDLX; 
DBConnect>str,dbRep
//
//Perform SELECT query
//
DBQuery>dbRep,SQL,CLIENTS,NumRecs,NumFields 
Message>records %NumRecs% 
Message>records %NumFields%
//
//Close database connection
DBClose>dbRep
Could you help me on this one please?

Thank you!

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

missing SQL

Post by adroege » Tue May 11, 2010 12:22 pm

//
//Perform SELECT query
//
DBQuery>dbRep,SQL,CLIENTS,NumRecs,NumFields
Message>records %NumRecs%
Message>records %NumFields%


First thing I notice is that there is no SQL query defined to run.
Like the following:

Code: Select all

Let>SQL=select * from your_table

DingDong
Newbie
Posts: 15
Joined: Tue May 11, 2010 11:28 am
Location: Canada

Post by DingDong » Tue May 11, 2010 12:46 pm

Thank you adroege for your answer. I have adjust the code.

Code: Select all

//Connect to Datasource
//
Let>str=Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Desjardins\Suvriq\Repres.mdb;User Id=admin;Password=XGVDLX; 
DBConnect>str,dbRep
//
//Perform SELECT query
//
Let>SQL=select * from CLIENTS
DBQuery>dbRep,SQL,CLIENTS,NumRecs,NumFields 
Message>records %NumRecs% 
Message>records %NumFields%
//
//Close database connection
DBClose>dbRep
MS is issuing an error message:

Image

As you can see it's french.

If I tried to translate:

Impossible to start your application. The working group file informations is absent or open in exclusive mode by another user.
Any idea how to solve this issue?

Thank you!

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 11, 2010 1:56 pm

I don't really know but to make a guess.

The error message indicates the file is in use and locked.

Your connection string indicates the file is on the C: drive. Perhaps the file location is shared and someone on the network has the file open. Or, do you have the file open in Access at the same time you're trying to open it from Macro Scheduler?

DingDong
Newbie
Posts: 15
Joined: Tue May 11, 2010 11:28 am
Location: Canada

Post by DingDong » Tue May 11, 2010 3:05 pm

Thank you JRL for your answer.

I have edit the script with another DB and the script worked.

This post should be edit as solved.

Again, thank you all.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts