In PHP, the Asscess database and COM program are called through ADO. Php (as the mainstream development language) 4 already supports Microsoft's COM technology. However, the COM section is rarely mentioned in this document. Here are some examples I have tried. I hope these will give you some php (as the mainstream development language) 4 that supports Microsoft's COM technology. However, the COM section is rarely mentioned in this document.
Here are some examples I have tried. I hope these will give you some ideas. Note that these can only run on a 32-bit Microsoft Windows platform.
Use php (as the mainstream development language) to activate ADO
ADO is Microsoft's database object technology. ADO contains the objects that connect to the database, the record set objects that return data from the query statement, and the field objects that represent data elements.
Many databases do not directly support ADO. Instead, many databases support two levels of Microsoft Database Technology: ODBC and OLEDB. many databases support ODBC, but OLEDB has a reputation for being faster than ODBC.
ADO is the API for packaging ODBC and OLEDB.
In this example, open a new ADO Connection object, open a traditional access (favorite of small websites) database for ODBC, and then execute SQL query, a record set object will be returned. Then we will display the first three fields of the record set.
$ Dbc = new COM ("ADODB. Connection ");
$ Dbc-> Provider = "MSDASQL ";
$ Dbc-> Open ("nwind ");
$ Rs = $ dbc-> Execute ("select * from products ");
$ I = 0;
While (! $ Rs-> EOF ){
$ I + = 1;
$ Fld0 = $ rs-> Fields (0 );
$ Fld1 = $ rs-> Fields (1 );
$ Fld2 = $ rs-> Fields (2 );
Print "$ fld0-> value $ fld1-> value $ fld2-> value
";
$ Rs-> MoveNext ();
}
$ Rs-> Close ();
?>
Use php (as the mainstream development language) to call Microsoft Word
This is another example:
$ Word = new COM ("word. application") or die ("Cannot start Microsoft Word ");
Print "Loaded word version ($ word-> Version )";
$ Word-> visible = 1;
$ Word-> Documents-> Add ();
$ Word-> Selection-> Typetext ("This is a test ");
?>
Http://www.bkjia.com/PHPjc/508876.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/508876.htmlTechArticlephp (as the current mainstream development language) 4 has supported Microsoft's COM technology. However, the COM section is rarely mentioned in this document. Here are some examples I have tried. I hope these will give you some...