Home > Backend Development > PHP Tutorial > PHP connection ACCESS_PHP tutorial

PHP connection ACCESS_PHP tutorial

WBOY
Release: 2016-07-15 13:22:07
Original
937 people have browsed it

<!--?PHP 
/* 
   创建ADO连接 
*/ 
$conn = @new COM("ADODB.Connection") or die ("ADO Connection faild."); 
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("DATUM/cnbt.mdb"); 
$conn--->Open($connstr); 
/* 
创建记录集查询 
*/ 
$rs = @new COM("ADODB.RecordSet"); 
$rs->Open("select * from dbo_dirs",$conn,1,3); 
/* 
   循环读取数据 
*/ 
while(!$rs->eof){ 
echo "$rs->Fields["title"]->Value; 
echo "
"; 
$rs->Movenext();     //将记录集指针下移 
} 
$rs->close(); 
?>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446995.htmlTechArticleOpen($connstr); /* Create record set query*/ $rs = @new COM(ADODB.RecordSet ); $rs-Open(select * from dbo_dirs,$conn,1,3); /* Loop to read data*/ while(!$rs-eof){ echo $rs-Fields[t...
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