correct the code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    correct the code

    i am using vb6 and access
    i had made a pasword on acces
    i use a module in the start of a project and make a connection
    using code
    this

    Code:
     
    DataPath = App.Path & "\mydatabase.mdb"
    con1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & DataPath & ";Persist Security Info=False"
    now as my database is password protected when i run my project
    its give me error
    "Invalid Password",

    so , what i had to change in this code,

    i had search the Howtoes where there is a turorial showing access
    database connection but unable to get the code becuse there is also
    a username in that but acces has no user name it has only password.
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Change your connection string:

    [CODE=vb]
    DataPath = App.Path & "\mydatabase.md b"
    con1.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source= " & DataPath & ";Persist Security Info=False; Jet OLEDB:Database Password=MyPwd"

    [/CODE]

    Regards
    Veena

    Comment

    Working...