#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    egypt
    Posts
    16
    Rep Power
    0

    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. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Cincinnati, Ohio
    Posts
    25
    Rep Power
    0
    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
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    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'
    Last edited by ngibsonau; February 26th, 2003 at 11:02 PM.
    --

    ngibsonau

IMN logo majestic logo threadwatch logo seochat tools logo