PHPODBC failed to connect to the ACCESS Database-php Tutorial

Source: Internet
Author: User
Tags odbc connection
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.