功能代码如下:

<?php
include ("conn/conn.php");
$sql = "select * from tb_user where id limit 5 "; //创建sql语句
$rst = $conn->execute ( $sql ) or die ( 'error: ' . $conn->errorMsg () ); //执行查询语句
$array = array ();
while ( ! $rst->EOF ) {
 $array ['id'] = $rst->fields ['id']; # process $arr
 $array ['user'] = iconv ( "utf-8", "gb2312", $rst->fields ['user'] ); # process $arr
 $array ['pass'] = $rst->fields ['pass']; # process $arr
 $array ['dates'] = $rst->fields ['dates']; # process $arr
 if ($_GET ['insert'] == "导出") {
  $sqls = "select * from tb_user where id=0 "; //创建sql语句
  $ret = $con->execute ( $sqls ) or die ( 'error: ' . $con->errorMsg () ); //执行查询语句
  $insert = $con->getInsertSQL ( $ret, $array ) or die ( 'update error:' . $con->errorMsg () ); //添加新数据
  $con->execute ( $insert );
 }
?>
          <tr>
    <td><?php
           echo $rst->fields ['id'];
           ?></td>
    <td height="20"><?php
           echo $rst->fields ['user'];
           ?></td>
    <td><?php
           echo $rst->fields ['dates'];
           ?></td>
   </tr>
        
          <?php
           
           $rst->movenext (); //指针下移
          }
          $rst->close (); //关闭连接
          $conn->close ();
        
          ?>

-------------------

conn.php


<?php
 include_once('../adodb5/adodb.inc.php'); //载入(include)adodb.inc.php文件
 $conn = ADONewConnection('mysql');  //建立连接
 $conn ->PConnect('localhost','root','111','db_database13'); //连接数据库
 $conn -> execute('set names utf8');   //设置编码格式
 $con = ADONewConnection("access");   //连接Access数据库
 $con ->PConnect("Driver={Microsoft Access Driver (*.mdb)};Dbq=E:\\Program File\\phpdevlepe\\AppServ\\www\\practice\\13\\545\\conn\\data\\db_database13.mdb");
 $con ->execute('set names gb2312');   //设置编码格式
?> 

如果是sqlserver 则是:$conn-> PConnect("Driver={SQL Server};Server=localhost;Database=db_database13;",'sa','');这个格式