vb这个哪儿错了??

来源:百度知道 编辑:UC知道 时间:2024/06/28 08:55:23
运行这个之后有提示说select附近有错误 还有refresh的方法AIdodc失败
关于"select * from sign where driver_comid= " & Text1.Text & ""
这句已经改了好多遍 网上的都试过了 希望大侠们能检查出些别的 感激不尽 为了这个问题我已经送出去了30分了 然后就只剩5分了 这5分再没解决问题我就真的没分了..........

Private Sub Command1_Click()
Dim password As String

Adodc1.RecordSource = "select * from sign where driver_comid= " & Text1.Text & ""
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
password = Adodc1.Recordset.Fields("driver_code")
If Text2.Text = password Then
If Mid(Text1.Text, 1, 6) = "driver" Then
Form2.Show
End If
If Mid(Text1.Text, 1, 6) = "consul" Then
Form3.Show
End If
If Mid(Text1.Text, 1, 6) = "manage" Then
Form4.Show
End If
Unload Me
Else
MsgBox "Sorry, the pass

"select * from sign where driver_comid= ‘ " & Text1.Text & " ’"
这种写法试试看

Else
MsgBox "Sorry,the ID is not exist", , "Notice"
Text1.Text = ""
Text2.Text = ""
End If
这个else之前没有if啊,如果你要改,就把上面一个else改成elseif试试