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

Conection Issues

Status
Not open for further replies.

ClulessChris

IS-IT--Management
Joined
Jan 27, 2003
Messages
890
Location
GB
Sorry if you find this question inappropraite to this forum (I'm kind o desperate). I'm using VBS to connect to an access 97 database. This works fine until I password protect the database. When trying to connect to a password protected database I get the err "Cannot start your application. The workgroup information file is missing or opened exclusively by another user."

Function Item_Open()
Dim sSelect
'On Error Resume Next
If Item.SenderName = "" Then
sSelect
= "V:\ServiceSelector\ServiceSelector.mdb"
Set m_adoSerSel = OpenAccessDB
(sSelect, "admin", "irate")
End If
End Function

Function OpenAccessDB(sDBPath, UID, PWD)

Dim objADOConn
Dim sConn
'On error Resume next

sConn = "Provider=Microsoft.Jet.OLEDB.4.0; " &_
"Data Source=" & sDBPath & "; " &_
"User ID=" & UID & "; " & _
"Password=" & PWD & "; "

Set objADOConn = CreateObject("ADODB.Connection")
ObjADOConn.Open sConn

If (err = 0) And (objADOConn.State = adStateopen)
Then
Set OpenAccessDb = objADOConn
Else
Set OpenAccessDB = Nothing
End If

Set objADOConn = Nothing

End Function


Please Note I've commented out the error handlers to help
debugging (but it didn't help that much). Any help or pointer you may be able to give will be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top