如下引用字段值为什么不对???在线等待
asp3 2003-11-29 11:31:00 正确的代码如下:
if vardm<>"" then
Recordset1.Source = "SELECT dmmc FROM g_dmqqq where zaldm='QQGDDY' and dm='"&vardm&"'"
Recordset1.Open()
if not Recordset1.eof and not Recordset1.bof then
vardm=Recordset1("dmmc")
end if
Recordset1.close()
end if
而下面却不对为什么?
dim varbyqs
varbyqs=0
Recordset1.Source = "SELECT count(byqjbh) as byqs FROM test where hh='"&varhh&"'"
Recordset1.Open()
if not Recordset1.eof and not Recordset1.bof then
varbyqs=Recordset1("byqs")
end if
Recordset1.close()
这个varbyqs始终没有值,而实际在SQL下运行是有值的