PHP COM Connection Adodb.connection Database

Source: Internet
Author: User
Tags php tutorial

$iishost = new COM ("Npoint_m.host"); ' Load component
$r = $iishost->iisstate (10, 1, "", "", ",", ""); ' Run component function, return parameter
Echo $r; ' Return parameters
Switch NET version to
Netstate (Ifid, DirName, Netver, Iissapp, Bkwebip, Bkpass, Webfiletype, Bkport)
Parameter description: Ifid as Ingeter:iis website identifier
DirName As String: directory name such as: BBS or Abcabdabe ... And so dirname is null default to Site
Netver As String:. NET version number
Iissapp As String: The name of the switched application pool can be left blank (independent process pool is limited)
. NET version number (for example: "v1.1.4322" version number in C:windowsmicrosoft.netframework. Net Folder name)
Note: Switching the. NET version, except for the standalone process pool, the other must switch the application pool because. net1.1 and ... net2.0. Cannot coexist
Bkwebip As String: Charged access URL/IP
Bkpass As String: Controlled access password
Webfiletype As String: controlled site file format such as: ASP tutorial
Bkport As Integer: Managed site ports such as: 999
* Successful return 1 otherwise return error hint

Here's a PHP tutorial using COM connection adodb.connection Database Tutorial * *

   //access Execution Class
    class db{
        var $conn; The
       //var $rs _n;//Records the number of current Rs.
       /link
        function Create ()
        {
             $this->conn = @new com ("adodb.connection"); //This is 13 lines
             $str = "Driver=microsoft Access Driver (*.mdb);d bq=". Realpath ("./dbdata/ Yuan555.mdb ");
            $ $this->conn->open ($STR);
           //return $this-> $conn;
       }

Establish a method
function query ($sql)
{
$_rs = @new com ("Adodb.recordset");
$_rs->open ($sql, $this-> $conn, 1, 1);
return $_rs;
}
}

Instantiating classes
$DB =new db ();
$db->create ();
//--------------------------------
$rs = $db->query ("SELECT * from Product");
$rs->close ();
$rs = null; But the close is finished, it must be null.
$db->close ();

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.