做了个VB连接SQL的工资管理系统,有个登录界面的代码想请教一下,exesql()怎么用?
Private Sub Command1_Click()
On Error GoTo Errhandler:
Dim sql As String
Dim rs As ADODB.Recordset
Dim intUserKey As Integer
Dim intJobId As Integer
If Trim(txtusername.Text = " ") Then
MsgBox "请输入用户名称!", vbExclamation
txtusername.SetFocus
Else
sql = "select * from users where username=' " & txtusername.Text & " ' "
Set rs = exesql(sql)
If rs.EOF = True Then
MsgBox " 没有此用户,请重新输入用户名!", vbExclamation
txtusername.SetFocus
Else
If Trim(rs!userpassword) = Trim(Txtpassword.Text) Then
Intauthority =rs !jobID
Strusername = txtusername.txt
rs.Close
Me.Hide
Frmain.Show
Unload Me
Else
MsgBox "密码不正确,请重新输入密码!", vbExclamation
Txtpassword.SetFocus
Txtpassword.txt = " "
End If
End If
End If
Exit Sub
Errhandler:
MsgBox "错误号: " & "错误描述:" & Err.Description
End Sub
提示子程序或函数未定义