代码问题!!给分!!

sugui 2003-04-15 04:17:46
下面的代码提示“do while not rst.EOF”出错!!
set cn=server.CreateObject("adodb.connection")
set rst = server.CreateObject("adodb.recordset")
set rstUser = server.CreateObject("adodb.recordset")
cn.ConnectionTimeout = 300
cn.Open Session("DZCRM_connection_string")

strSql = "Select CustomerName,Address from CustomerBaseInfo"
rst.Open strSql,cn,1
do while not rst.EOF
RoadFeeName=rst("CustomerName")
RoadAddress=rst("Address")
rst.Close
...全文
20 4 打赏 收藏 举报
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
pengdali 2003-04-15
set cn=server.CreateObject("adodb.connection")
set rst = server.CreateObject("adodb.recordset")
set rstUser = server.CreateObject("adodb.recordset")
cn.NonnectionTimeout = 300
cn.Open Session("DZCRM_connection_string")

strSql = "Select CustomerName,Address from CustomerBaseInfo"
rst.Open strSql,cn,1
while not rst.EOF
RoadFeeName=rst("CustomerName")
RoadAddress=rst("Address")
rst.next
rst.Close
  • 打赏
  • 举报
回复
SophiaWang 2003-04-15
set cn=server.CreateObject("adodb.connection")
set rst = server.CreateObject("adodb.recordset")
set rstUser = server.CreateObject("adodb.recordset")
cn.ConnectionTimeout = 300
cn.Open Session("DZCRM_connection_string")

strSql = "Select CustomerName,Address from CustomerBaseInfo"
rst.Open strSql,cn,1
do while not rst.EOF and not rst.BOF
RoadFeeName=rst("CustomerName")
RoadAddress=rst("Address")
Loop
rst.Close
  • 打赏
  • 举报
回复
sugui 2003-04-15
i will try it
  • 打赏
  • 举报
回复
CrazyFor 2003-04-15
TRY:

set cn=server.CreateObject("adodb.connection")
set rst = server.CreateObject("adodb.recordset")
set rstUser = server.CreateObject("adodb.recordset")
cn.ConnectionTimeout = 300
cn.Open Session("DZCRM_connection_string")

strSql = "Select CustomerName,Address from CustomerBaseInfo"
rst.Open strSql,cn,1

do while not (rst.EOF and rst.bof)

RoadFeeName=rst("CustomerName")
RoadAddress=rst("Address")
rst.Close
  • 打赏
  • 举报
回复
发帖
MS-SQL Server

3.4w+

社区成员

MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
帖子事件
创建了帖子
2003-04-15 04:17
社区公告
暂无公告