Results 1 to 6 of 6

Thread: database password !!

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    database password !!

    Hi ,
    I wanna open protected database (access 97 ) .I tried this but seems not hlep :
    VB Code:
    1. Dim myPath As String = Application.StartupPath
    2. Dim myConnection As New OleDb.OleDbConnection("provider=Microsoft.jet.oledb.4.0;DATA SOURCE=" _
    3. & myPath & "\DBWEB.MDB;" & "Jet OLEDB: Database Password=" & "mypassword;")
    4. Try
    5. myConnection.Open()
    6. Catch x As Exception
    7. MsgBox(x.Message())
    8. 'It keep throwing this error :
    9. couldn't find installable ISAM.
    10. End Try
    Any hlep would be highly appreciated !

  2. #2
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Thumbs up

    This is a good resource: ConnectionStrings.com

    I use this in my code:
    VB Code:
    1. Public Const ACCESS2K = "Provider=Microsoft.Jet.OLEDB.4.0;Password='';User ID=Admin;Data Source='C:\myData.mdb';"
    ~Peter


  3. #3

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    that's wonderful site ! Many thanks .I will try to solve the problem.

  4. #4

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    what happens then if the path was a const as follow :
    VB Code:
    1. Dim path As String = "C:\db1.mdb"
    2. 'I tried this but with error of course
    3.  
    4. Dim MyConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= path;Jet OLEDB:Database Password=aaa;")
    this time ,the path is throwing an error. any ideas plz ??

  5. #5
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277
    Did you forget how to use a variable?
    VB Code:
    1. Dim sDBPath As String = "C:\db1.mdb"
    2. Dim MyConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" & sDBPath & "';Jet OLEDBatabase Password=aaa;")
    I'm sure it was just a momentary brain lapse.
    ~Peter


  6. #6

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    hehe . thanx thanx . Dunno what's wrong with my PC recently(actually it me not my PC).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width