Re: (Leo) ADO Connection Error

Tech-Archive recommends: Fix windows errors by optimizing your registry




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





.



Relevant Pages

  • Re: Permissions error trying to open MDB file with ODBC
    ... I have set the sharing/security on the folder where the MDB file ... Do you use an UNC path or a mapped drive? ... Do you use a DSN-less connection with a connection string? ... Try the DSN way, first local, then remote. ...
    (comp.lang.php)
  • Re: Problem accessing Access/Jet databse: Could not lock file
    ... not lock file" when opening a connection to an Access database on a network ... shared folder. ... Since the .mdb file can be opened using Access and everything can be done, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Leo) ADO Connection Error
    ... The database password is separate and distinct from any user-level password ... I have an Access mdb file with exclusive file password. ... Dim cn As New ADODB.Connection ... Is there a difference between the connection string password and mdb ...
    (microsoft.public.access.externaldata)
  • Re: Cant Open OleDb Connection to Access Database
    ... When setting the data source in the connection string, ... > when I try to connect to an .mdb file on a network share, ... > and granting full control permissions on the share to everyone doesn't ...
    (microsoft.public.dotnet.framework.adonet)
  • How to programming to apply User-Level Security to a mdb file
    ... I have a system database (mdw) file and a normal mdb file. ... code to make the mdb file apply User-Level Security. ...
    (microsoft.public.access.security)