Home > php教程 > php手册 > php adodb连接带密码access数据库实例,测试成功

php adodb连接带密码access数据库实例,测试成功

WBOY
Release: 2016-06-13 12:28:49
Original
985 people have browsed it

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

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

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

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template