老妈的三国时代刘凤仙:ADO高手过来帮帮忙

来源:百度文库 编辑:神马品牌网 时间:2024/05/16 05:28:17
Private Sub Command1_Click()
Dim inputno As String
Dim passwd As String
Dim ssql As String
ssql = "select passwd from stu_fee where lab_no=" & inputno
inputno = Text1.Text
passwd = Text2.Text
Set rs = cn.Execute(ssql)
开始连接数据库都一切OK,就是运行到最后一句说“=”号附近有语法错误。。

ssql = "select passwd from stu_fee where lab_no=" & inputno
这句呢

ssql = "select passwd from stu_fee where lab_no='" & inputno &"'"
因为你是字符串嘛