php操作access

<span style="font-size:12px;font-family:arial;">
<?php
 $conn=new COM("ADODB.Connection");
 $conn_str="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=".realpath("1.mdb").";";
 $conn->open($conn_str);
 $sql = "select * from userinfo";
 $res = $conn -> execute($sql);
 while(!$res -> EOF) {
 echo $res ->fields['username']->value." ";
 echo $res ->fields['datetime']->value ;
 echo "<br/>";
 $res -> movenext();
 }
 $sql = "insert into userinfo(username) values('名称')";
 $res = $conn -> execute($sql);
?>
</span>
    A+
发布日期:2009年04月14日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: