Access with password in a MS-Access Database 
Author Message
 Access with password in a MS-Access Database

Hi! there is a way to do this on ADO with a Connection Object:

Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\My
Proyects\Data\Data.mdb;Jet OLEDB:Database Password=dddd;"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select Code, Name from MyTable", db, adOpenStatic,
adLockOptimistic

but somebody knows how to do it with a OpenDatabase method?

Dim MyWs as Workspace
Dim MyDb as Database
Dim MyRs as Recordset

Set MyWs = Workspaces(0)
Set MyDb = MyWs.OpenDatabase("C:\My Proyects\Data\Data.mdb")
Set MyRs = MyDb.OpenRecordset("MyTable")

but the password? how can i do this whit a OpenDatabase Method?

Thanks.



Wed, 31 Jul 2002 03:00:00 GMT  
 Access with password in a MS-Access Database

Quote:
> Dim MyWs as Workspace
> Dim MyDb as Database
> Dim MyRs as Recordset

> Set MyWs = Workspaces(0)
> Set MyDb = MyWs.OpenDatabase("C:\My Proyects\Data\Data.mdb")
> Set MyRs = MyDb.OpenRecordset("MyTable")

> but the password? how can i do this whit a OpenDatabase Method?

You'll need to create a new workspace instead of using Workspace(0). When
creating the new workspace you supply the login and password to use:

         Set MyWs = DBEngine.CreateWorkspace("wsWorkspace", _
                                                            strLogin,
strPassword, dbUseJet)

--
Wayne Howarth
Software Programmer, Petrodata Ltd.
www.petrodata.co.uk



Sun, 04 Aug 2002 03:00:00 GMT  
 Access with password in a MS-Access Database


Fri, 19 Jun 1992 00:00:00 GMT  
 Access with password in a MS-Access Database
Hi,
I have the same problem in Visual C++. I can use DAO workspace
to do this, but I want to support all ODBC drivers and don't want to
write all my code twice...
But I didn't succeed in connecting to an Access database with
database password and user security level; ODBC seems to know
just one "password" (PWD).

Can anybody tell me a way to connect with this database with ODBC
(NOT with DAO please)?
Thomas



Fri, 16 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Access with password in a MS-Access Database

2. how do i access a password protected MS-ACCESS db without the password

3. Regarding Accessing External database using MS-Access and MS-Visual Basic

4. Database Password problem - MS Access

5. Using MS Data Control DAO to access a password protected database

6. Accessing MS Access97 database using non-printable password

7. Accessing MS Access97 database using non-printable password

8. Accessing MS Access97 database using non-printable password

9. How do I connect to a ms access database that is secure and has a password

10. Connect VB data control to a password protected MS Access database

11. Change MS Access database password through ADO (how?)

12. Printing MS Access Report from password protected database

 

 
Powered by phpBB® Forum Software