note 118022 deleted from function.odbc-connect by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 12:20:11 +0000 |
| Subject: | note 118022 deleted from function.odbc-connect by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208556@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
how to solve Error SQL state S1009 connecting to an access database in a network with odbc
1 - if you dont have access installed in your computer, you will need the access driver for odbc
conection...install with mdactypex (just for 32 bits)... or AccessDatabaseEngine_X64.exe for 64bits
2 - give needed rights to a windows user profile to run as a service: Control panel, Administrative
tools, in the left treeview panel, select Local Security Policies, User Rights Assignment, and in
the right panel find and select 'Logon as a service', right button click and
properties-> Search and add the user User in your computer you want to Apache use to login at
service start
3 - Go to Windows Services admin, select Apache, edit properties, select login tab, and set the
previuos user you use (write his windows login password)
4- Use php code like this:
$user="your_db_user";
$password="your_db_password";
// Conexion Access con ODBC
// Important: (4 initial slashes!) \\\\network_path\dir_name\...
$mdbFilename='\\\\servidor\data\AccessBD.mdb';
$conn_access = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename",
$user, $password);