Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open a connection with security on msaccess database?
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Open a connection with security on msaccess database?
Miscellaneous
Thread ID:
00531137
Message ID:
00531137
Views:
50
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
Map
View

Click here to load this message in the networking platform