OpenDatabase Method in DAO 
Author Message
 OpenDatabase Method in DAO

Hi,

I'm trying to open an Access database to which I have set User Level
Security and encryption, however I am unable to open it thru code.

Dim db as database
Dim UserName As String
Dim Password As String
Dim UserLevel as String

Set db = OpenDatabase(App.Path & "\avtracker.mdb",uid= & UserName & ,pwd= &
Password &, usr= & UserLevel &)

I have tried variations on the above, commas , semi-columns, etc, I still
have not found the proper wording

Any suggestions on how  I can change my code to open a database that has a
User Name, database password and User Level security?

I would really appreciate anybody's help, since this is the last step before
I deliver my app and I am already late.

Thank you in advance for your reply

Richard



Sat, 17 Nov 2001 03:00:00 GMT  
 OpenDatabase Method in DAO
Hi there,
Try it this way

Quote:

> Set db = OpenDatabase(App.Path & "\avtracker.mdb ' ",uid= & UserName &
,pwd= &
> Password &, usr= & UserLevel & " ' ")

everything from uid= is passed as a string and should be within quotes.
Havn't tried it myself , but looks the obviuos candidate.

Quote:

> I have tried variations on the above, commas , semi-columns, etc, I still
> have not found the proper wording

> Any suggestions on how  I can change my code to open a database that has a
> User Name, database password and User Level security?

> I would really appreciate anybody's help, since this is the last step
before
> I deliver my app and I am already late.

> Thank you in advance for your reply

> Richard




Sat, 17 Nov 2001 03:00:00 GMT  
 OpenDatabase Method in DAO
Richard,

If I'm not barking up the wrong tree you might find that the user level
passwords and stuff fall under the auspices of the Workspace object. I never
use passwords and stuff for the access databases - just disguise them by
using peculiar extensions (our users aren't too computer literate
thankfully) - however on looking up the help I think you'll find you need a
couple of extra commas prior to sending the database password. The syntax of
the OpenDatabase action runs as follows;

Set database = workspace.OpenDatabase (dbname, options, read-only, connect)

The connect aspect is where the password should go - have a bash at.....

Set db = OpenDatabase(App.Path & "\avtracker.mdb",,,"pwd;" &
Password)

As far as the user stuff goes you'd be best advised to have a look at the
help in Access on the WorkSpace Object - as I've never used these I can't be
of much help.

Hope this is a help and not a hindrance,

Davy

Quote:

>Hi,

>I'm trying to open an Access database to which I have set User Level
>Security and encryption, however I am unable to open it thru code.

>Dim db as database
>Dim UserName As String
>Dim Password As String
>Dim UserLevel as String

>Set db = OpenDatabase(App.Path & "\avtracker.mdb",uid= & UserName & ,pwd= &
>Password &, usr= & UserLevel &)

>I have tried variations on the above, commas , semi-columns, etc, I still
>have not found the proper wording

>Any suggestions on how  I can change my code to open a database that has a
>User Name, database password and User Level security?

>I would really appreciate anybody's help, since this is the last step
before
>I deliver my app and I am already late.

>Thank you in advance for your reply

>Richard




Mon, 19 Nov 2001 03:00:00 GMT  
 OpenDatabase Method in DAO
I was having the same problem about a week ago.  I searched a site that
showed how to use the Access password.  You won't believe the simple answer
if you don't already know.  In Access set a database password, not a user
password.  In VB use the following syntax:

set db = openDatabase("location of file", false, false, ";pwd = password")

What we do wrong is not put the true/false in.  If you don't put the
true/false in VB don't recognize the password.  I have tried it and it works
perfectly.  Unbelievable how long it took me to figure it out.  I was doing
it with just the commas and no words too.  Just don't work.

Larry



Sat, 24 Nov 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. OpenDatabase Method in DAO

2. DAO 3.5 opendatabase method and password protected Access 97 databases

3. Access security / DAO OpenDatabase

4. OpenDatabase using DAO 2.5

5. DAO/dBase 5.0/OpenDataBase

6. DAO.DBEngine.OpenDatabase Error

7. Password and OpenDatabase Method Error 3031

8. OpenDatabase Method

9. Problem with OpenDatabase method with long path name

10. Opendatabase method

11. OpenDatabase method

12. OpenDatabase method not working???

 

 
Powered by phpBB® Forum Software