[PHP-WIN] odbc_connect unknown error
Hello!. I have a problem when trying to connect to an access database: $con = odbc_connect($dsn,$user,$pass) or die(odbc_error()); the error message i get is just this: IM002 the $dsn var only contains the name of a data source previously created from the windows control panel. i already tested the $dsn making a connection with visual basic code and it works fine. Also the user and pass are right. so i dont know what could be the problem. I am using PHP 5.2.4-win32. with apache 2.2.4. I really appreciate any help on this. Alexander _ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
RE: [PHP-WIN] odbc_connect unknown error
> 1) Does the user running the web process have access to the file using> the > path provided?> 2) Did you set the DSN as a System DSN?> 3) Try using a > DSN-less connection, namely:> > $dsn = "Driver={Microsoft Access Driver > (*.mdb)}; DBQ=" + $fullpathtodb;> $con = odbc_connect($dsn,$user,$pass) or > die(odbc_error());> > John Ok, it worked fine using the extended connection string you wrote in the example. I wonder if there is a way to connect to a remote database, what i'm doing now is upload the .mdb file to the server and use it as local, but it would be better connect to the remote system. _ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us