Alteczen Posted September 24, 2008 Share Posted September 24, 2008 I'm trying to connect to a MS Access database that uses a workgroup file for security (.mdw). I'm using the ADODB class with a DSN-less connection: My code is: include('adodb5\adodb.inc.php'); $db = 'path/to/db.mde'; $wg = 'path/to/dbSecurity.mdw'; $user = 'bob'; $pass = 'joe'; $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$db;SystemDB=$wg;Uid=$user;Pwd=$pass;"; $conn = ADONewConnection('access'); $conn->debug = true; $conn->Connect($dsn) or die("Connection Failed"); And my response: Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Not a valid account name or password., SQL state 08004 in SQLConnect in C:\wamp\www\gc\adodb5\drivers\adodb-odbc.inc.php on line 60 Connection Failed. I'm looking for help from someone who has experience connecting to an Access db that uses a workgroup file for security. I've been through pages of Google results with nothing concrete that has worked. The response mentions "Not a valid account name or password". But I'm 99% sure the user/pass is correct. I'm hoping there is just an issue with my $dsn string. If I change the paths to the .mde or .mdw files to something completely wrong I get the same response - thus it's possible that it's not choking on the user/pass combo. I'd love to use a different database but it's not an option. The database comes from another company and it's what I have to work with. Thanks in advance for any tips or help you can provide! Link to comment https://forums.phpfreaks.com/topic/125611-access-database-connection-help/ Share on other sites More sharing options...
Schlo_50 Posted September 24, 2008 Share Posted September 24, 2008 The only way I have done this successfully was by setting up a system DSN. Link to comment https://forums.phpfreaks.com/topic/125611-access-database-connection-help/#findComment-649433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.