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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO ConnectionString issues

Status
Not open for further replies.

SiJP

Programmer
May 8, 2002
708
0
0
GB
I've an AccessXP db connecting to an Access97 db using the following code:
Code:
        Set cn = New ADODB.Connection
            cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydb.mdb;Jet OLEDB:System Database=C:\mysec.mdw;"
            cn.Open , "myuser", "password"

The following message is returned when opening the connection (e.g. break point is cn.open):

Error said:
-2147217843 Cannot start your application. The workgroup information file is missing or opened exclusively by another user.

I've checked that the paths to both mdb and mdw files are correct, and the uid/pwd is fine. The MDW is used for all our databases, so I have had to use it to open the AccXP db.

Any ideas gyus?


------------------------
Hit any User to continue
 
Would you have to have XP and 97 both installed on the same machine that is running the code? Just a thought...

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Figured it out.. trailing vbcr's on the end of some variables in the connection string... (was using variables instead of string literals for the file paths..!)

------------------------
Hit any User to continue
 
I am surprised this worked on an Access 97 database.
Provider=Microsoft.Jet.OLEDB.4.0
My understanding was that Access 97 was Jet.OLEDB.3.5 format.
 
True that acc97 is 3.51, but 4.0 is supported.. :D

------------------------
Hit any User to continue
 
use a udl file for ado connection purposes. it will save you a lot of time and hassel, you will find out how to make them on the microsoft web site or just look through google, its really worth your while and only takes a few seconds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top