日期:2014-05-17  浏览次数:20886 次

这样取值,怎么总是出错?
Rs.open   "select   *   from   DingDan   where   DingDanID=int(DingDanID) ",conn,1,1
Rs2.open   "select   *   from   RequestOrder   where   DingDanID=DingDanID   and   UserName=UserName ",conn,1,1

Response.write(Rs( "DingDanID "))
Response.write(Rs2( "DingDanID "))

然后我用
Rs( "DingDanID ")取得的值是数据库的第一条记录,而不是符合条件的记录

Rs2( "DingDanID ")取得的值也是数据库的第一条记录,而不是符合条件的记录
请问,问题出在那里了

------解决方案--------------------
Rs.open "select * from DingDan where DingDanID= " & int(DingDanID),conn,1,1
Rs2.open "select * from RequestOrder where DingDanID= " & DingDanID & " and UserName= ' " & UserName & " ' ",conn,1,1