PHP代码:
-
<?php
-
$connstr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" .realpath("data.mdb");
-
$connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC);
-
$issuetime=date("Y-m-d H:i:s");
-
$sql="insert into test values("","",...)";
-
$result=odbc_exec($connid,$sql);
-
if($result) echo "successful";
-
else echo "failed";
-
?>
之二:
-
<?PHP
-
//创建ADO连接
-
$conn = @new COM("ADODB.Connection") or die ("ADO连接失败!");
-
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" .realpath("temp/TempData.mdb");
-
$conn->Open($connstr);
-
-
//创建记录集查询
-
$rs = @new COM("ADODB.RecordSet");
-
$rs->Open("select * from blog_Content",$conn,1,3);
-
echo $rs->Fields["log_Title"]->Value; //输出log_Title字段
-
echo "<br/>";
-
$rs->Movenext(); //将记录集指针下移
-
echo $rs->Fields["log_Title"]->Value;
-
$rs->close();
-
?>
阿里云资讯,阿里云服务器,阿里云免费备案,阿里云技术支持。QQ332465082