可能是SQL语句有错,
select * from xxx where null
改为
select * from xxx where 1=2
试下.

解决方案 »

  1.   

    nanman(南蛮) 回答的是对的,你再试一试,你应该给他加分的。
      

  2.   

    adLockPessimistic 保守式记录锁定(逐条)。提供者执行必要的操作确保成功编辑记录,通常采用编辑时立即锁定数据源的记录的方式 
      

  3.   

    你弹出的的是rs1.locktype的值也就是你前面给的adlockpressimistic
    rs1.locktype=1和rs1.locktype=adlockpressimistic同效
      

  4.   


    rs1.LockType = adLockPessimistic
    Set rs1 = conn.Execute("select * from xxx where null")
    改为:
    rs1.Open "select * from xxx where 1=2", conn, adOpenDynamic, adLockPessimistic, adCmdText
    try again.
      

  5.   

    用conn.Execute返回的记录集只能是只读向前移动的,你虽然指定adLockPessimistic,但被返回的记录集覆盖了,用rs1.Open "select * from xxx where null", conn, adOpenDynamic, adLockPessimistic, adCmdText
      

  6.   

    这么麻烦,不如用:
    conn.execute("insert into ......")
    conn.execute("update ......")