Connection to MDA file

  • Thread starter Thread starter Michael Henry
  • Start date Start date
M

Michael Henry

Hello,
I have created an mda file used as a source for common
code for other mdb files. In the mdb files I use
connection strings to query local tables. However, in
the mda file there are tables that will also be used by
other mdb files. The problem that I am running into is
this. Within the mda file I try to set a
connectionstring back to that file but when I reach the
code that does this ie.
Set cnnCost = New ADODB.Connection
cnnCost.ConnectionString
= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data
Source=H:\MSAccessDbSecurity\LIBRARY\SearchTools_Library.m
da; " & _
"User ID=" & CurrentUser & ";" & _
"Jet OLEDB: System Database
=H:\MSAccessDbSecurity\SacSecure.mdw;" & _
"Mode=Share Deny None;"
cnnCost.Open

I get the following error when I try to open the cnnCost
connection "Run-time error -2147217843(80040e4d). Cannot
start your application. The workgroup information file is
missing or opened exclusively by another user."

Can anyone give me some ideas about what to check for?

thanks Mike Henry
 
I'm not wholly sure I read your post correctly. I think you
need to use the CodeProject property to set the connection
back into your MDA where the code is executing.

Set cnnCost = CodeProject.Connection
 
Back
Top