CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Timisoara, Romania
    Posts
    460

    Question Error when connecting to pass protected db

    Hi all,
    I'm tring to connect to a password protected microsoft access mdb file and I get an error about "Could not find installable ISAM"
    The connection string is like this:
    Code:
    OleDbConnection aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + 
    				"User Id=admin;Password:xxx;Jet OLEDB:Engine Type=5;Persist Security Info=True;" +
    				"Data Source=C:\\Documents and Settings\\Mihai\\Desktop\\Imobiliare\\Vita\\BD\\anunturi.mdb");
    The thig is that if I try to open a mdb file that has no password and I remove the part about User Id and Password from the conn string it works.
    Can someone help me out?
    Thank you!
    Last edited by vma; September 3rd, 2006 at 04:23 PM.
    You liked it? Please show your gratitude and rate it!

    There is no 'patch' for stupidity.

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Error when connecting to pass protected db

    You are setting the password in the wrong place. It's a common problem with passworded MDB and it drove my bonkers for weeks. Do this:

    make a new file on the desktop called A.UDL
    Double click it
    Go through the tabbed screens and make data entries suitable for your database. (Jet OLE DB Provider)
    DO NOT FILL IN THE PASSWORD BOX IN THE CONNECTION TAB
    On the ALL tab, 5 item down is DatabasePassword
    Set THIS password entry to the DB password

    Test the connection

    Open the UDL file in Notepad. There is your needed connection string.


    The conecntion string looks like:
    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=some database;Persist Security Info=False;Jet OLEDB:Database Password=db_password
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  3. #3
    Join Date
    Oct 2003
    Location
    Timisoara, Romania
    Posts
    460

    Re: Error when connecting to pass protected db

    So where do I find this db_password and how do I deal with this password data base when I'm giving the aplication to someone else?
    You liked it? Please show your gratitude and rate it!

    There is no 'patch' for stupidity.

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

Featured