Home  >  Article  >  Backend Development  >  PHP adodb connection with password access database instance, test successful

PHP adodb connection with password access database instance, test successful

高洛峰
高洛峰Original
2016-12-30 14:31:241960browse

<?     
include(&#39;./class/adodb/adodb.inc.php&#39;);            
//实例化db类,链接            
$db = ADONewConnection(&#39;ado_access&#39;);            
    $access = realpath(&#39;./rs.mdb&#39;);             
    $myDSN = &#39;PROVIDER=Microsoft.Jet.OLEDB.4.0;&#39;.&#39;DATA SOURCE=&#39;. $access . &#39;;&#39;."Jet OLEDB:Database Password=123456;";         

$db->Connect($myDSN);          
$recordSet = $db->Execute(&#39;select * from tt&#39;);     
if (!$recordSet)      
        print $db->ErrorMsg();     
else    
while (!$recordSet->EOF) {     
        print $recordSet->fields[0].&#39; &#39;.$recordSet->fields[1].&#39;<BR>&#39;;     
        $recordSet->MoveNext();     
}     

$recordSet->Close(); # 选择性执行     
$db->Close(); # 选择性执行     
?>

For more php adodb connection with password access database examples, please pay attention to PHP Chinese website for related articles about successful test!

Statement:
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