主题:查询问题
我在做查询的界面,但是出现错误了,大家帮忙看下
错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
代码在下面:
<table width="200" border="1" align="center">
<tr>
<td align="center">编号</td>
<td align="center">菜名</td>
<td align="center">价格</td>
</tr>
<%
dim name
name=request.Form("name")
dim conn
set conn=server.createobject("adodb.Connection")
conn.connectionString="Dbq=C:\Inetpub\wwwroot\canting.mdb;Driver={Microsoft Access Driver (*.mdb)}"
conn.mode=0
conn.open
dim comm
set comm=server.CreateObject("adodb.Command")
comm.ActiveConnection=conn
comm.Commandtype=1
dim sqlstr
sqlstr="Select * from caipu where name='"&session("name")&"'"
comm.commandtext=sqlstr
set dbrs=comm.execute
do while not rs.eof
%>
<tr>
<td align="center"><%response.Write(rs("number"))%></td>
<td align="center"><%response.Write(rs("name"))%></td>
<td align="center"><%response.Write(rs("price"))%></td>
</tr>
<% rs.movenext
loop %>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
错误类型:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
代码在下面:
<table width="200" border="1" align="center">
<tr>
<td align="center">编号</td>
<td align="center">菜名</td>
<td align="center">价格</td>
</tr>
<%
dim name
name=request.Form("name")
dim conn
set conn=server.createobject("adodb.Connection")
conn.connectionString="Dbq=C:\Inetpub\wwwroot\canting.mdb;Driver={Microsoft Access Driver (*.mdb)}"
conn.mode=0
conn.open
dim comm
set comm=server.CreateObject("adodb.Command")
comm.ActiveConnection=conn
comm.Commandtype=1
dim sqlstr
sqlstr="Select * from caipu where name='"&session("name")&"'"
comm.commandtext=sqlstr
set dbrs=comm.execute
do while not rs.eof
%>
<tr>
<td align="center"><%response.Write(rs("number"))%></td>
<td align="center"><%response.Write(rs("name"))%></td>
<td align="center"><%response.Write(rs("price"))%></td>
</tr>
<% rs.movenext
loop %>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>