web 2.0

How to use PHP & AdoDB (COM ADO)

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
?>
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

One Response to “How to use PHP & AdoDB (COM ADO)”

  1. 2cadence…

Leave a Reply

You must be logged in to post a comment.