谁能教我用VB做个登录系统

来源:百度知道 编辑:UC知道 时间:2024/09/23 06:54:56
百度上详细告诉我
谢谢了

access数据库、adodc控件

Private Sub Command1_Click()
Adodc1.RecordSource = "select * from 表 where 用户名='" & Text1 & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "没有这个用户,请重新输入!", , "注意"
Text1.SetFocus
Else
If Text2 = Adodc1.Recordset.Fields("密码") Then
Unload Me
form2.Show
Else
MsgBox "密码错误,请重新输入!", , "注意"
Text2.SetFocus
End If
End If

End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
Adodc1.RecordSource = "select * from 表"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\数据库.mdb;Persist Security Info=False"
Adodc1.Refresh

End S