怎么不能提出数值型变量?,糟了....帮帮我!!..........
<%
Dim conn,rs,SQLstring,showblank,shownull,whatever,count,thisfield
Dim tempdata
SQLstring = "SELECT clpz,czmc,dhhm,xj FROM tb_hz where dhhm like '68578772'"
showblank = " "
shownull = "空"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Mode = 1
conn.Open "RYLF"
'Set rs = conn.Execute(SQLstring)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open SQLstring, conn, 1,1
count = rs.recordcount
IF rs.eof THEN
Response.Write "no this recorde"
END IF
FOR each whatever in rs.fields
Response.Write whatever.name & " "
NEXT
Response.Write "<BR>"
DO UNTIL rs.eof
FOR each whatever in rs.fields
thisfield = whatever.value
IF isnull(thisfield) THEN
thisfield = shownull
END IF
IF trim(thisfield) = "" THEN
thisfield = showblank
END IF
Response.Write thisfield & " "
NEXT
Response.Write "<BR>"
rs.Movenext
LOOP
rs.Close
Set rs = nothing
conn.Close
Set conn = nothing
Response.Write "符合条件的记录共有" & count & "条。"
Response.End
%>
用的DB2数据库
当在SELECT 中有数值型变量xj时,返回查找到的记录条数count=0(实际上不为0);
若没有数值型变量xj时,则为正常返回值。
为什么?谢谢