|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using an access db
Hi imtrying to access my access db wich is password protected from vb6
Set db = OpenDatabase(App.Path & "\datbwc.mdb") this is the string i was using till i set the password now im lost as what to do. or where to put the password info |
|
#2
|
|||
|
|||
|
This string should be what you are looking for:
Set db = OpenDatabase(App.Path & "\datbwc.mdb", False, False, "ODBC;pwd=mypassword") You have to specify that parameter 2 and 3 are False, otherwise if you just try to leave them out it reads "ODBC..." as parameter 2 and will throw up a nasty error. |
|
#3
|
|||
|
|||
|
error '3151'
I get an error that says the odbc connection faild
|
|
#4
|
||||
|
||||
|
Try something like this:
Code:
Set db = New ADODB.Connection
With db
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;"
.CursorLocation = adUseClient
.Open
End With
Check out www.connectionstrings.com, it does exactly what it says on the tin!!! |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Using an access db |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|