CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    Password Protected

    i am using ado and access for databse
    my database has a passowrd how do i open it through coding?


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Password Protected

    'connection to secure database
    Dim Cnn As ADODB.Connection
    Dim Rst As ADODB.Recordset

    'In the place where you want to establish your connection, such
    'as the Initialize event of a class module, enter the following:

    Dim strConnect As String
    Set Cnn = New ADODB.Connection

    'Substitute your own User IDs, Password, Data Source, and System
    'database in the connection string below
    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Password=MyPassword;User ID=Administrator;" & _
    "Data Source=C:\AccessDBs\DB1.mdb;" & _
    "Persist Security Info=True;" & _
    "Jet OLEDB:System database=C:\AccessDBs\system.mdw"

    With Cnn
    .CursorLocation = adUseClient
    .Open strConnect
    End With

    Set Rst = New ADODB.Recordset
    Rst.ActiveConnection = Cnn

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    Re: Password Protected

    thanx for ur help
    but still i need ur help
    now it is giving me an error undefined user id or wrong password
    the thing is i have not set any user id to that database(cause i dont know how 2) but i tried "Admin" or the full word but it is not working plzz help me
    thanx once agin
    bye & take care
    sarfaraz..........


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