CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2002
    Posts
    10

    How to connect 2 password-protected MDB

    Hi,

    How do you do this? Is it in the connection string? If yes, could you give me an example; I am using MSAccess 97. Thanks.

  2. #2
    Join Date
    Dec 2001
    Location
    India
    Posts
    42

    Cool

    It seems pretty simple. I faced problem while using a provider for a dsn-less connection though.

    May be any guru would care to tell if provider works for a password protected mdb, and how.

    This is my class for creating a global connection object
    Code:
    Private Sub Class_Initialize()
      Set cn = New ADODB.Connection  'public connection object
      With cn
        .CursorLocation = adUseClient
        .ConnectionString = "DSN=dsnname;UID=admin;PWD=pwd;"
        .Open
      End With
    End Sub
    Last edited by debuchakrabarty; May 24th, 2002 at 12:23 AM.
    Regards

    Debashish Chakrabarty
    SCJP

    ******************************
    Cool Site for SCJP aspirants at:
    http://www.geocities.com/wahjava
    ******************************

  3. #3
    Join Date
    May 2002
    Posts
    10
    debuchakrabarty or anybody,

    That's exactly my problem, I don't want to use a DSN connection. Is it possible to use a DSN-less connection to access a password-protected mdb? How?

  4. #4
    Join Date
    May 2002
    Posts
    25

    Accessing Password Protected Access Database

    Hello Buddy:

    Well to access the password protected database, without a dsn you have to use the following connection string

    (To access a Database having password on the Databse Level)

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Test.mdb;Jet OLEDBatabase Password=abc

    (To access a Database having password on the user Level)


    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Test.mdb;User id=ky;password=abc

    I hope that it solves ur problem



  5. #5
    Join Date
    May 2002
    Posts
    10
    Mr. Kyakub,

    I used your 1st ex since it's protected at db level, but it returned an error:

    -2147467259: Could not find installable ISAM.

    What could be the problem now?

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    Goto microsoft download center, and search for "Jet" and or "Isam".
    You should find latest release of it (jet 4.0...), which is not included in MDAC_TYP.exe

    This should solve the matter

    Cesare
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  7. #7
    Join Date
    Dec 2001
    Location
    India
    Posts
    42

    Thumbs down Provider Problem

    I downloaded the Jet40SP6_9xNT.exe for winnt and installed. However now on running 'ADO could not find the specified provider' error comes.
    Regards

    Debashish Chakrabarty
    SCJP

    ******************************
    Cool Site for SCJP aspirants at:
    http://www.geocities.com/wahjava
    ******************************

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