Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BUG in ODBC opening secure Access Database

2 views
Skip to first unread message

SamNET

unread,
Jan 22, 2004, 12:31:07 PM1/22/04
to
I'm using ODBC to open an Access Database (Access 2002). It's fine if the db is NOT secure. The minute I add a password to it the open connection fails with the error:

ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Not a valid password

my connect string is

sConnect="Provider=MSDASQL.1;Mode=ReadWrite;DSN=DSNData;MaxBufferSize=2048;PageTimeout=20;UID=Admin;PWD=MyPassword"

The password is valid!

other code is:
Dim cConn As Microsoft.Data.Odbc.OdbcConnection = New Microsoft.Data.Odbc.OdbcConnection

cConn.ConnectString = sConnect
cConn.Open()

The same code (without the psw and uid) works perfectly fine if the database has no password.

Frank Hickman

unread,
Jan 22, 2004, 2:32:12 PM1/22/04
to
The password your specifying in the connection string is not a database
password, it's a user password. If your secure your database with a
password this method will not work. If it is a user password, then make
sure your DSN contains the full path to the workspace file your database is
using when you set the password. This workspace file system.mdw is usually
in the System32 folder. I would offer a solution to the database password
option but I don't know how to do it in ODBC. Anyone?

--
Frank


"SamNET" <anon...@discussions.microsoft.com> wrote in message
news:95718940-58F3-4858...@microsoft.com...

Russ Gray [MS]

unread,
Jan 22, 2004, 6:11:13 PM1/22/04
to
From http://www.able-consulting.com/ADO_Conn.htm

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:Database Password=MyDbPassword", _
"myUsername", "myPassword"



Thanks,

Russ Gray
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.


SamNET

unread,
Feb 2, 2004, 1:11:08 PM2/2/04
to
Mr Russ I'm still hoping that you can provide an example on how to open a secure MS Access Database using a DSN (where you do not specify the filename or location).

Because your example does not work when you use a DSN. I've searched "ALL" of msdn.Microsoft.com and have not found a way to do it.

Frank Hickman

unread,
Feb 2, 2004, 2:17:51 PM2/2/04
to
When using a DSN, you need to specify the system database in the DSN's
definition.

HTH
--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


"SamNET" <anon...@discussions.microsoft.com> wrote in message

news:65F1C7C8-9FE1-41AC...@microsoft.com...

0 new messages