note 109593 added to function.odbc-connect
| From: | diogotbrito at gmail dot com | Date: | Tue, 31 Jul 2012 20:31:00 +0000 |
| Subject: | note 109593 added to function.odbc-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189532@lists.php.net to get a copy of this message | ||
Abhinav, off course you can use ".accdb". Just use the correct driver.
For .mdb extension, use:
Driver={Microsoft Access Driver (*.mdb)}
For .accdb, use:
Driver={Microsoft Access Driver (*.mdb, *.accdb)}
"Microsoft Access Driver (*.mdb)" already comes with windows, "Microsoft Access
Driver (*.mdb, *.accdb)" you need to install "Microsoft Access Database Engine" in http://www.microsoft.com/en-us/download/details.aspx?id=13255
(AccessDatabaseEngine.exe or AccessDatabaseEngine_x64.exe)
So you'll be able to work with .mdb and .accdb.
ex:
$argHostname = "c:/wwwroot/teste.accdb";
if(substr($argHostname, "-6") == ".accdb")
{
$argHostname = "DBQ=". $argHostname .";DefaultDir=".
realpath(dirname($argHostname)) .";Driver={Microsoft Access Driver (*.mdb, *.accdb)};FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;";
}
else
{
$argHostname = "DBQ=". $argHostname .";DefaultDir=".
realpath(dirname($argHostname)) .";Driver={Microsoft Access Driver (*.mdb)};FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;";
}
odbc_connect($argHostname);
----
Server IP: 89.187.142.233
Probable Submitter: 177.43.188.50
----
Manual Page -- http://www.php.net/manual/en/function.odbc-connect.php
Edit -- https://master.php.net/note/edit/109593
Del: integrated -- https://master.php.net/note/delete/109593/integrated
Del: useless -- https://master.php.net/note/delete/109593/useless
Del: bad code -- https://master.php.net/note/delete/109593/bad+code
Del: spam -- https://master.php.net/note/delete/109593/spam
Del: non-english -- https://master.php.net/note/delete/109593/non-english
Del: in docs -- https://master.php.net/note/delete/109593/in+docs
Del: other reasons-- https://master.php.net/note/delete/109593
Reject -- https://master.php.net/note/reject/109593
Search -- https://master.php.net/manage/user-notes.php