|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
password in conn string (*.mdb)
i use this
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=D:\Work\ash\batesdb.mdb" but don't know how 2 provide "uid=login;pwd=my password" thank u all |
|
#2
|
|||
|
|||
|
If this is an Access database why the username and password? Something like this should work fine:
Code:
<%
Set DataConnection = Server.CreateObject("ADODB.Connection")
DataConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & "YOUR DATABASE PATH AND NAME & ";"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = DataConnection
SQL = "SELECT * FROM tbl.Whatever"
cmdDC.CommandText = SQL
cmdDC.CommandType = 1
Set RecordSet = Server.CreateObject("ADODB.Recordset")
'-- Opening record set
'-- Cursor Type, Lock Type
'-- ForwardOnly 0 ReadOnly 1
'-- KeySet 1 Pessimistic 2
'-- Dynamic 2 Optimistic 3
'-- Static 3 BatchOptimistic 4
RecordSet.Open cmdDC, , 3, 2
%>
dot |
|
#3
|
|||
|
|||
|
To answer faithology, Because some people put passwords on Access databases so they have a little bit of security on them.
If you don't set a Provider in the connection string I think it defaults to "MSDASQL.1" Here is a connection string that opens Access databases and allows passwords. Code:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Work\ash\batesdb.mdb; Jet OLEDB:Database Password=dbpass;" i had to edit so you could see the the face Jet OLEDB:<- then 'Database'
__________________
-- ngibsonau Last edited by ngibsonau : February 26th, 2003 at 11:02 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > password in conn string (*.mdb) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|