Cannot open password protected MDB file using DAO

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Venkat (vreddyg_at_hotmail.com)
Date: 04/12/04


Date: Mon, 12 Apr 2004 13:24:13 +0530

Hi,

I've developed an application (VB 6.0, DAO 3.6 Object library, Access 2000).
I need to password protect the MDB file. And I made the changes in
application also, where I was opening the database.

Code is as follows:

Dim db As Database
Set db = OpenDatabase("c:\db1.mdb", False, False,
"ODBC;UID=admin;pwd=hello")

But I get the following error:

Run-time error '3151':
ODBC -- Connection to 'c:\db1.mdb' failed.

But when I open the db without password (reset in db also), it opens.

Dim db As Database
Set db = OpenDatabase("c:\db1.mdb", False, False, "")

Can anybody please help me how to open a password protected MDB file using
DAO in VB 6.0?

Thanks in advance
Venkat



Relevant Pages

  • Cannot open password protected MDB file using DAO
    ... I need to password protect the MDB file. ... where I was opening the database. ... Dim db As Database ...
    (microsoft.public.vb.database)
  • Re: Basic read data from, minimum code
    ... I'm fine messing with text and stuff, but database has always left me cold ... ... What I want to do is take an .mdb file and I need to print each record into a file as a text file. ... Dim db As ADODB.Connection ...
    (microsoft.public.vb.database)
  • Re: System.Data.OleDb.OleDbException: Operation must use an updateable query.
    ... Make sure the ASPNET account has ... Change permissions to the directory where the .mdb file is located. ... Cannot Connect to Access Database from ASP.NET ... > Dim cnMemberUpdate as OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Form development ideas
    ... Here is my code for generating a new database using the name of the state ... Dim LFilename As String ... 'Path and file name for new mdb file ...
    (microsoft.public.access.formscoding)
  • Re: Form development ideas
    ... Dim LFilename As String ... 'Path and file name for new mdb file ... 'Make sure there isn't already a file with the name of the new database ...
    (microsoft.public.access.formscoding)