mPublic.con.Execute "DELETE [userlist]  where userlist.userId=txtid.Text"
txtid.text是一文本框

解决方案 »

  1.   

    mPublic.con.Execute "DELETE [userlist]  where userlist.userId='" & txtid.Text & "'"
      

  2.   

    如果是数字的话去掉单引号
    mPublic.con.Execute "DELETE [userlist]  where userlist.userId=" & txtid.Text & 可用IsNumeric(txtID.Text)来判断是否输入了数字或在txtID_Press中加入代码来控制:
    Dim Numbers As String
        
        Numbers = "1234567890" + Chr(8) + Chr(46)
        If InStr(Numbers, Chr(KeyAscii)) = 0 Then KeyAscii
      

  3.   

    mPublic.con.Execute "DELETE [userlist]  where userlist.userId='" & txtid.Text & "'"
      

  4.   

    mPublic.con.Execute "DELETE from userlist  where userId='" & txtid.Text & "'"