How to use PHP & AdoDB (COM ADO) This Tutorials/Script Developing with the PHP Scrips Using ADO (AdoDB) call to a resource on windows serverĀ and related function.
ShotDev Focus:
- PHP & ADO
Syntax for Microsoft Access
$strConn = new COM(”ADODB.Connection“) or die(”Cannot start ADO”);
$strConn->Open(”DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=” . realpath(”database.mdb“),”user“,”password“);
Syntax for SQL Server
$strConn = new COM(”ADODB.Connection“) or die(”Cannot start ADO”);
$strConn->Open(”Driver={SQL Server};Server=host;Database=database;UID=user;PWD=password;”);
Syntax for Oracle
$strConn = new COM(”ADODB.Connection“) or die(”Cannot start ADO”);
$strConn->Open(”Driver={Oracle in OraHome92};DBQ=TNS-NAME;UID=user;PWD=password;”);
Syntax for MySQL (MyODBC)
$strConn = new COM(”ADODB.Connection“) or die(”Cannot start ADO”);
$strConn->Open(”DRIVER={MySQL ODBC 5.1 Driver}; SERVER=host;UID=user;pwd=password;database=database;option=16384;”);
Syntax for ODBC
$strConn = new COM(”ADODB.Connection“) or die(”Cannot start ADO”);
$strConn->Open(”DSNname (ODBC)“,”user“,”password“);
Method,Property
<? $strConn = new COM("ADODB.Connection") // Start ADO Connection $strConn->Open(); // Open Connection $strConn->Execute() // Execute SQL $objRec->EOF // End Of Record $objRec->Fields["CountryCode"]->Value; // Get fields ?>
2cadence…
…