Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open a connection with security on msaccess database?
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Open a connection with security on msaccess database?
Divers
Thread ID:
00531137
Message ID:
00531137
Vues:
52
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform