以下是工作中收集几个的数据库连接程序,可用于测试数据库。 access 2003连接程序(asp): % dim dbpath,connstr,conn dbpath=#bjbaidu.mdb connstr=driver=microsoft access driver (*.mdb);dbq=server.mappath(dbpath) set conn = server.createobject(
以下是工作中收集几个的数据库连接程序,可用于测试数据库。
access 2003连接程序(asp):
dim dbpath,connstr,conn
dbpath=#bjbaidu.mdb
connstr=driver=microsoft access driver (*.mdb);dbq=&server.mappath(dbpath)
set conn = server.createobject(adodb.connection)
conn.open connstr
%>
access 2007连接程序(asp):
dim dbpath,connstr,conn
dbpath=123.accdb
connstr=driver=microsoft access driver (*.mdb, *.accdb);dbq=&server.mappath(dbpath)
set conn = server.createobject(adodb.connection)
conn.open connstr
%>
access连接(php):
open($connstr);
/*
* 创建记录集
*/
$rs = @new com(adodb.recordset);
$rs->open(select * from bj_link,$conn,1,3);
/*
* 循环读取数据
*/
while(!$rs->eof){
echo $rs->fields['title']->value;
echo
;
$rs->movenext(); //将记录集指针下移
}
$rs->close();
?>
mysql连接(php):
如需更多数据库连接代码,请访问http://www.connectionstrings.com/。