【问题标题】:Operation is not allowed in this context Moveprevious在此上下文中不允许操作 Moveprevious
【发布时间】:2015-11-04 20:18:48
【问题描述】:

我收到错误 ADODB.Recordset error '800a0c93'

在此上下文中不允许对recordset3.moveprevious 进行操作。

我相信这可能与光标类型有关?我已经尝试添加

recordset3.CursorType = adOpenDynamic
recordset3.open FINDPART,adoCon 

但得到同样的错误。

有人能看出我的代码有什么问题吗?

 set recordset3=Server.CreateObject("ADODB.recordset")
recordset3.open FINDPART,adoCon,3,3

 <% do while not recordset3.eof %>

   <% if recordset3.fields("product2") = findme then
   response.write("yes")
   recordset3.movenext
   nextpart = recordset3.fields("product2")
   recordset3.moveprevious
   recordset3.moveprevious
   previouspart = recordset3.field("product")
   exit do
   end if

   recordset3.movenext
   loop%>

【问题讨论】:

    标签: vbscript asp-classic adodb recordset


    【解决方案1】:

    已解决 - 光标类型需要为 1

    set recordset3=Server.CreateObject("ADODB.recordset")
    recordset3.cursortype =  1
    recordset3.open FINDPART,adoCon
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-03
    • 2019-10-19
    • 2021-04-13
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多