Re: (Leo) ADO Connection Error
- From: "Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 Aug 2006 13:51:15 +0100
Provider=Microsoft.Jet.OLEDB.4.0; - You probably know this one, specifies
which provider to use.
User ID=Admin; - Not necessary if you're not using user-level security, as
'Admin' is the default. If you were using user-level security instead of or
in addition to the database password, you'd specify the user name and the
user password (not the database password) like so ... User
ID=SomeUser;Password=SomePassword;
Data Source=c:\usenet\passtest.mdb; - I'm sure you know this one, the path
and name of the data file.
Jet OLEDB:Database Password=Whatever; - The database password (not the user
password, see above). The 'Jet OLEDB:' prefix identifies this as a
JET-specific extended property rather than a standard OLEDB property.
Persist Security Info=False; - I won't try to explain that one myself.
Here's a link to an MSDN article that explains it instead ...
http://msdn2.microsoft.com/en-us/library/ms254499.aspx
--
Brendan Reynolds
Access MVP
"Leo" <Leo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4B515837-9361-44AE-B736-39ACD29BE712@xxxxxxxxxxxxxxxx
Thanks a lot....it worked great, though I can not analyse what each part
of
the string mean.
--
Thans & Best regards
Leo, InfoSeeker
"Brendan Reynolds" wrote:
The database password is separate and distinct from any user-level
password
that may be applied, yes. Here's an example of a connection string that
includes a database password ...
Const strcConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;"
& _
"User ID=Admin;Data Source=c:\usenet\passtest.mdb;" & _
"Persist Security Info=False;Jet OLEDB:Database
Password=Whatever"
--
Brendan Reynolds
Access MVP
"Leo" <Leo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:74574A55-C966-4229-8971-140CF95A2172@xxxxxxxxxxxxxxxx
Hi,
I have an Access mdb file with exclusive file password. From Excel I
attempt
to connect to the file, it produces Automation Error no -2147217843.
the code looks like this;
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "C:/DB.mdb", "Admin", "MyPassword"
End With
when I remove the password from my mdb file it works well.
Why? Is there a difference between the connection string password and
mdb
file password?
if So, how can I principally make a connection with mdb file with
password?
--
Thans & Best regards
Leo, InfoSeeker
.
- References:
- Re: (Leo) ADO Connection Error
- From: Brendan Reynolds
- Re: (Leo) ADO Connection Error
- Prev by Date: Re: (Leo) ADO Connection Error
- Next by Date: Re: dealing with max number of fields
- Previous by thread: Re: (Leo) ADO Connection Error
- Next by thread: Re: dealing with max number of fields
- Index(es):
Relevant Pages
|