有代码,帮我看看怎么修改。关于VB运行Access查询语句的格式
Private Sub cmd2_Click()Dim stracc, strrecord As String
Dim ADOrs As New Recordset
ADOrs.ActiveConnection = ADOcn
If txt2.Text = "" Or txt1.Text = "" Then
MsgBox "账号或密码不能为空!", vbCritical + vbOKOnly
Exit Sub
Else
stracc = "select 操作员姓名,操作员密码 from 用户登录表 "
stracc = stracc + "where 操作员姓名=" + txt2.Text + "and 操作员密码=" + txt1.Text + ""
ADOrs.Open stracc
If Trim(ADOrs("操作员姓名")) = " + txt2.Text + " And Trim(ADOrs("操作员密码")) = " + txt1.Text + " Then
If MsgBox("信息内容已通过,是否要进入管理界面?", vbQuestion + vbYesNo) = vbYes Then
MDIForm1.Show
strrecord = "insert into 系统日志表(登录日期,操作员姓名)"
strrecord = strrecord + "values(" + Date + "," + cmb2.Text + ")"
ADOcn.Execute strrecord
End If
Else
MsgBox "操作员姓名不存在或密码错误!", vbCritical + vbOKOnly
Exit Sub
End If
End If
End Sub
能指出错误点教我怎么改最好 做毕业设计遇到的问题 谢谢