Home > Backend Development > PHP Tutorial > access database software A revised version of calling the Access database through the ADODB library in PHP Original

access database software A revised version of calling the Access database through the ADODB library in PHP Original

WBOY
Release: 2016-07-29 08:35:59
Original
1132 people have browsed it

The most important download address, please read the previous article first.
http://adodb.sourceforge.net/#download
Local download PHP中通过ADODB库实现调用Access数据库之修正版本 原创 Download this file
Unzip this file and put it in the adodb directory, preferably all of them, not just ohtml.inc.php and adodb.inc.php
You only need to quote these two

Copy the code The code is as follows:


include('adodb/tohtml.inc.php'); // load code common to ADODB
include('adodb/adodb.inc.php'); // load code common to ADODB
$db = &ADONewConnection("ado_access");
print "

Connecting $db->databaseType...< ;/h1>";
$access = 'E:phpphpaccesstest.mdb';
$myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'.'DATA SOURCE='. $access.';USER ID=; PASSWORD=;';
//Attention, the mdb address is a physical address
if (@$db->PConnect($myDSN, "", "", "")) {
print "ADO version=". $db->_connectionID->version.";
";
$sql = 'select thename from news';
$rs = $db->Execute($sql);
rs2html($rs,'border =2 cellpadding=3',array('Customer Name','Customer ID'));
} else print "ERROR: Access test requires a Access database $access".';
'.$db->ErrorMsg( );
?>


As for the database, the ordinary access database is the same as normal, there is nothing to pay attention to
The test passed. If you have any better suggestions, please point them out in the comments

The above introduces the access database software. The revised version of Access database calling through the ADODB library in PHP is original. It includes the content of access database software. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template