择偶标准最重要的五点:asp问题类型不匹配

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/07 09:13:35
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html><head><title>报修系统</title>
<%
sub outhf(dh)

%>
<%
set conn1=server.createobject("adodb.connection")
conn1.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("bxjl.mdb")

exec1="select * from xlqk where xldh="+dh (这是出错的行)
set rs1=server.createobject("adodb.recordset")
rs1.open exec1,conn1,1,1
response.write "<table width=650 border=1 align=center cellPadding=0 cellSpacing=0 bordercolor=7C7C7C >" %>
<%do while not rs1.eof %>
<tr>
<%=rs1("hfr")%>在
<%=rs1("hfsj")%>回复:

<%=rs1("hfnr")%>
<%
rs1.movenext
loop
%>
<%
response.write "</tr></table>"

rs1.close
set rs1=nothing
conn1.close
set conn1=nothing
end sub
%>

</head>
<body>

<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("bxjl.mdb")
%>

<%
exec="select * from bxjl order by zhhf desc,bxsj desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>

<%

For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if
%>
<table>
<tr>
<td>
<% call outhf(rs("bxdh")) %>在这调用的
</td>
</tr>

</table>

<%
rs.MoveNext
next
%>

<%
rs.close
Set rs = Nothing
conn.close
set conn=nothing
%>
</body>
</html>

其中xljl 表中 bxdh 类型是自动编号
xlqk表中 xldh是长整形

出现如下错误

Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: '[string: "select * from xlqk w"]'

/index.asp,行83

我该怎么办? 急阿

你的rs.pagesize是没有设置值的,不能这样用!最好你换成do while not rs.eof.......loop形式。另外不赞成你在“exec1="select * from xlqk where xldh="+dh ”中用的“+”号,最好用“&”,改成“exec1="select * from xlqk where xldh="&dh&"" ”