关于连接Access数据库异常问题
<P>代码如下:</P><DIV class=htmlcode>
<P><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank" >http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>"><BR><html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank" >http://www.w3.org/1999/xhtml</A>"><BR><head><BR><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><BR><title>Php论坛</title><BR><link href="Style/Style.css" rel="stylesheet" type="text/css" /><BR></head><BR><body><BR><table width="700" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#996633"><BR> <tr><BR> <td align="center" height="20"><font color="#FFFFFF"><b>帖子列表</b></font></td><BR> </tr><BR> <?php<BR> $Conn=new com("adodb.connection");<BR> $Db=realpath("Database/bbs.mdb");<BR> $Conn->open("driver=microsoft access driver (*.mdb);dbq=".$Db);<BR> $Rs=$Conn->execute("Select * From Bbs Order By BbsId Desc");<BR> if($Rs->eof && $Rs->bof)<BR> {<BR> ?><BR> <tr><td height="100" align="center" bgcolor="#ffffff">无记录</td></tr><BR> <?php<BR> }<BR> else<BR> {<BR> while(!$Rs->eof)<BR> {<BR> ?><BR> <tr><BR> <td align="center" valign="top" bgcolor="#ffffff"><BR> <table width="700" align="center" border="0" cellpadding="0" cellspacing="0"><BR> <tr><BR> <td align="center" width="50" height="20" bgcolor="#ffffff"><? echo($Rs->fields["BbsId"]); ?></td><BR> <td align="left" width="400" height="20" bgcolor="#ffffff"><? echo($Rs->fields["BbsTitle"]); ?></td><BR> <td align="center" width="100" height="20" bgcolor="#ffffff"><? echo($Rs->fields["BbsAuthor"]); ?></td><BR> <td align="center" width="150" height="20" bgcolor="#ffffff"><? echo($Rs->fields["BbsTime"]); ?></td><BR> </tr><BR> </table><BR> </td><BR> </tr><BR> <?php<BR> $Rs->movenext;<BR> }<BR> }<BR> $Rs->close();<BR> $Conn->close();<BR> ?><BR></table><BR></body><BR></html></P></DIV><BR>运行第一次时,没有错误.当再次刷新时,说对象关闭,不允许操作.谁知道是为什么?而且还抛出异常 不清楚PHP怎么连接ACCESS<br>我也看不出有什么问题,不好意思
[align=right][color=#000066][此贴子已经被作者于2007-3-30 22:54:55编辑过][/color][/align]
页:
[1]
