Results 1 to 3 of 3

Thread: Openind password protected database .......

  1. #1

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535
    I am want to open a password protected MS Access database with DAO from my program. But I want to open the databse with the password entered in a text box. I am using the following statement :

    Set DB = OpenDatabase(App.Path & "\Data.mdb", False, False, ";pwd=Text1.Text")

    But this does not work out and the "Invalid Password" error is displayed.

    Can someone tell me how to open a database by entering its password in the textbox and sending the textbox value to the database?

    Please help me out.

    Thanks in advance.
    Kinjal


  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb

    Since you Text1.Text is an variable so you need to put in in this way.

    Code:
    Set DB = OpenDatabase(App.Path & "\Data.mdb", False, False, ";pwd=" & Text1.Text & ")"

  3. #3

    Thread Starter
    Fanatic Member kinjalgp's Avatar
    Join Date
    Apr 2000
    Location
    India
    Posts
    535
    Thanks a lot Chris and Mikef

    This is very simple thing.


    Thanks once again.

    kinjal

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