$scriptname = split('[/]',$_SERVER['SCRIPT_NAME']);
$filename = end($scriptname);
$MM_Conn_STRING="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("www.111cn.net/a.mdb") ." ;DefaultDir=". realpath(".");
$Conn=new COM("ADODB.Connection");
$RS =new COM("ADODB.RecordSet");//数据集
$Conn->open($MM_Conn_STRING);//链接打开数据源
$query="select * from doubt";
$RS->open($query,$Conn,1,1);//执行语句,返回记录集
$pagesize=$RS->Pagesize=3;//设置每页显示条数
if($RS->PageCount0){//防止数据库教程为空
if(!empty($_GET['page'])){
if($_GET['page']
$RS->AbsolutePage=1;
$nowpage=1;
}elseif($_GET['page']>$RS->PageCount){
$RS->AbsolutePage=$RS->PageCount;
$nowpage=$RS->PageCount;
}else{
$RS->AbsolutePage=$_GET['page'];
$nowpage=$_GET['page'];
}
}else{
$RS->AbsolutePage=1;
$nowpage=1;
}
}else{
$nowpage = 1;
$pagesize = 0;
}
echo "当前显示第".$nowpage."页 ";
echo "每页".$pagesize.'条 ';
echo "共有".$RS->RecordCount."条记录 ";
echo "共有".$RS->PageCount."页
";
for ($m=1; $m
{
echo "
$RS->MoveNext();
//if($RS->PageCount==0){
//echo "没有数据";
}
if($RS->PageCount0){//防止数据库为空
echo "首页 ";
if (!($nowpage
echo "上一页 ";
}
if (!($nowpage>=$RS->PageCount)){
echo "下一页 ";
}
echo "PageCount.">尾页 ";
}
//释放资源
$Conn->Close();
$RS=NULL;
$Conn =NULL;