String1 = "select * from sunxiaofei where 会员卡号='" & FormAddModify.TextHuiYuanKaHao.Text & "'"
    rst.Open String1, cnn, adOpenKeyset, adLockOptimistic
我是这样做的,为什么会有这个提示:实时错误'-2147217904 (80040e10)':
至少一个参数没有被指定值。

解决方案 »

  1.   

    String1 = "select * from sunxiaofei where 会员卡号=" &  "'" & FormAddModify.TextHuiYuanKaHao.Text & "'"
    应该是你上面 的句子写错了
      

  2.   

    在VB里寫SQL文時,要在變量的兩邊加上 '" & 和 & "' 以告訴VB這是變量,不是字段,
    sql 语句中指定的字段与表中的不一样
      

  3.   

    表名叫sunxiaofei?看起来是一个人名啊,会不会是某一个表中的记录的内容?
      

  4.   

    select 字段 from 库.dbo.表 where 
    如果cnn为当前库,则略写为
    select 字段 from 表 where