General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Open a connection with security on msaccess database?
hi all -
i'm using vb6 sp5 and an ms access2000 database. i can access the database fine with the code below but i'm having trouble when i put a password on the database. the error that i receive is "run-time error: could not find installable ISAM". the code below is what i'm using for establishing a connection and the error occurs on the line "oConn.Open strConnection". the database name is security and so is the password.
***** begin
Dim oConn As New ADODB.Connection
Dim rsObj As ADODB.Recordset
Dim strConnection, strQuery, strDBPath As String
Dim strPwd As String
Dim strDatabasePath As String
strDBPath = "c:\data\test\"
Set rsObj = New ADODB.Recordset
rsObj.CursorLocation = adUseClient
' get password for database
strPwd = "security"
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "security.mdb;Pwd=" & strPwd & ";Persist Security Info=False"
strQuery = "select * from security"
oConn.Open strConnection
rsObj.ActiveConnection = oConn
rsObj.Open strQuery, , adOpenDynamic, adLockPessimistic
If rsObj.EOF = False Then
rsObj.MoveFirst
End If
*** end
any thoughts? TIA
piper
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only