adooR.Open "select * from 表明 where 字段1= & pubid And 字段2 =  & Countbingli, adooC, adOpenStatic, adLockOptimistic, adCmdText"     ’pubid and countbingli是全局变量

解决方案 »

  1.   

    adooR.Open "select * from 表明 where 字段1='" & pubid "'And 字段2 ='"  & Countbingli"', adooC, adOpenStatic, adLockOptimistic, adCmdText"试试
      

  2.   

    adooR.Open "select * from 表明 where 字段1= & pubid & "And 字段2 =" & Countbingli & "," & adooC & "," & adOpenStatic & "," & adLockOptimistic & "," & adCmdText
      

  3.   

    adooR.Open "select * from 表明 where 字段1='" & pubid "' And 字段2 ='"  & Countbingli & "', adooC, adOpenStatic, adLockOptimistic, adCmdText"
      

  4.   

    写错了。
    adooR.Open "select * from 表明 where 字段1= & pubid & "And 字段2 =" & Countbingli
      

  5.   

    adooR.Open "select * from 表明 where 字段1='" & pubid & "'And 字段2 ='" & Countbingli & "','" & adooC & "','" & adOpenStatic & "','" & adLockOptimistic & "','" & adCmdText
      

  6.   

    不会吧,一个都没对。pubid 和 countbingli 都是长整型的
      

  7.   

    adooR.Open "select * from 表明 where 字段1=" & pubid & " And 字段2 =" & Countbingli, adooC, adOpenStatic, adLockOptimistic, adCmdText