PHPODBC failed to connect to the ACCESS Database $ Connstr = "DRIVER = {Microsoft Access Driver (*. mdb)}; DBQ = ". realpath ("C: \ Users \ btang \ xampp \ htdocs \ InterfaceSatcli \ BdD_DO.mdb ");
$ Connid = odbc_connect ($ connstr, "", "", SQL _CUR_USE_ODBC );
Echo phpinfo ();
} Catch (Exception $ e ){
Echo "Connection failure Access impossible:", $ e-> getMessage ();
Die ();
}
?>
Reply to discussion (solution)
To connect to ACCESS, the mdb file directory must have the permission of the general user. Please check
To connect to ACCESS, the mdb file directory must have the permission of the general user. Please check
Put it under my own user name, so I have the right to execute and I am not an administrator account
You need to check the permission attributes.
Php works as an anonymous user and belongs to the users group.
You need to check the permission attributes.
Php works as an anonymous user and belongs to the users group.
I added the EVERYONE user group to ACCESS and gave full control. The folder where the project is located is also added.
An error is reported after the Pdo odbc Connection is changed. the registry cannot be opened.
Finally, odbc_connect is used.
The previous error was reported because the data source win7 was not set in c: \ windows \ SysWOW64 \ odbcad32.exe.