|
-
Dec 1st, 2001, 08:16 AM
#1
Thread Starter
PowerPoster
Access Access database
how does one open a access database using ADODB which is protected with a password.
I know that u use some - conn.properties method - but I dont want to do it that way. any other way perphaps????
Also when I do try to open it then it informs me that the database shd have exclusive permissions
how do I do that??
-
Dec 1st, 2001, 09:48 AM
#2
Exclusive permision means, that no other program can use the database, while your program uses it, so you can't have it opened in ie. Access.
Under the ADODB.Connection object, in the code, where you open the db, add this line of code before you try to open the DB
.Properties("Jet OLEDB atabase Password") = "DATABASEPASSWORD"
Change DATABASEPASSWORD with the DB password.
That should do it.
-
Dec 1st, 2001, 09:50 AM
#3
%&¤#!%&# Smilies
Should have been
.Properties("Jet OLEDB:Database Password") = DATABASEPASSWORD
-
Dec 3rd, 2001, 02:04 AM
#4
Thread Starter
PowerPoster
I am getting this error:
The workgroup information file is missing or open exclusively by another user
The file is not open by any other user!!!!!!
-
Dec 3rd, 2001, 02:10 AM
#5
Fanatic Member
Access97 or Access2k DB?
-
Dec 3rd, 2001, 02:29 AM
#6
Thread Starter
PowerPoster
-
Dec 3rd, 2001, 02:31 AM
#7
Fanatic Member
Sounds like the database is protected by User Level Security.
In this case you will also need to put the following in you code before you open the database:
.Properties("Jet OLEDB:System database") = SYSTEMDATABASE
.Properties("User ID") = USERNAME
Replacing SYSTEMDATABASE with the full name and path of the system database (.mdw file) and USERNAME with the name of the user with the correct access rights. You would then replace the DATABASEPASSWORD with this users password.
Martin J Wallace (Slaine)
-
Dec 3rd, 2001, 02:42 AM
#8
Thread Starter
PowerPoster
Thanks
thanks a lot.
But now I am getting "Invalid password error"
So I switched back to the previous code i.e
without this stm :
.Properties("User ID") = USERNAME
Then to I am getting the same error - invalid password.
Now what shd I do?
-
Dec 3rd, 2001, 02:45 AM
#9
Fanatic Member
If you can send a sample of the code and the database I will have a look at it for you.
Either post it on here or email it to me.
Martin J Wallace (Slaine)
-
Dec 3rd, 2001, 02:51 AM
#10
Thread Starter
PowerPoster
hi
I pasting the code here.
Code:
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim mstr As String
mstr = App.Path & "\Library.mdb"
With conn
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & mstr
conn.Properties("Jet OLEDB:Database Password") = "12345"
End With
The exact error is :
Code:
Run Time error -21....
Not a valid password
Then it highlights the .open Line.
-
Dec 3rd, 2001, 03:39 AM
#11
-= B u g S l a y e r =-
VB Code:
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEST.MDB;Jet OLEDB:Database Password=SecretPass"
-
Dec 3rd, 2001, 03:50 AM
#12
Thread Starter
PowerPoster
Thanks a lot peet
It works now.
But just for my knowledge can u tell me why didnt work before?
-
Dec 3rd, 2001, 03:54 AM
#13
-= B u g S l a y e r =-
did u ever try switching the sequense?
assign password before opening the connection?
try
VB Code:
Dim mstr As String
mstr = App.Path & "\Library.mdb"
With conn
conn.Properties("Jet OLEDBatabase Password") = "12345"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & mstr
End With
-
Dec 3rd, 2001, 05:14 AM
#14
Thread Starter
PowerPoster
hi peet
Yes i did try that, but still gave me error : something - cannot find provider.....
-
Dec 3rd, 2001, 08:05 PM
#15
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|