Private Sub dl_Click()
Dim sql As String
Dim conn As New ADODB.Connection
Dim rs_login As New ADODB.Recordset
If Trim(txtzh.Text) = "" Then
MsgBox "账号不能为空", 0, "出错"
txtzh.SetFocus
Else
sql = "select * from data where user = '" & txtzh.Text & "'"
conn.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\date\data.mdb;"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "账号不存在,请重新输入!", vbOKOnly + vbExclamation, "错误"
txtzh.Text = ""
txtzh.SetFocus
Else
If Trim(rs_login.Fields(1)) = Trim(txtmm.Text) Then
rs_login.Close
Unload Me
dlsy.Show
Else
MsgBox "密码输入有误,请重新输入", vbOKOnly + vbExclamation, "错误"
txtmm.SetFocus
End If
End If
End If
End Sub
Private Sub Form_Load()
Dim conn As New ADODB.Connection
Dim connectionstring As String
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "E:\date\data.mdb;Persist Security Info=False"
conn.Open connectionstring
a = Weekday(Now())
If a = 1 Then
a = "礼拜天"
End If
If a = 2 Then
a = "礼拜一"
End If
If a = 3 Then
a = "礼拜二"
End If
If a = 4 Then
a = "礼拜三"
End If
If a = 5 Then
a = "礼拜四"
End If
If a = 6 Then
a = "礼拜五"
End If
If a = 7 Then
a = "礼拜八"
End If
why.Caption = "欢迎您,今天是" & a
why.ForeColor = RGB(255, 0, 0)
End Sub
Dim sql As String
Dim conn As New ADODB.Connection
Dim rs_login As New ADODB.Recordset
If Trim(txtzh.Text) = "" Then
MsgBox "账号不能为空", 0, "出错"
txtzh.SetFocus
Else
sql = "select * from data where user = '" & txtzh.Text & "'"
conn.Open "provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\date\data.mdb;"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "账号不存在,请重新输入!", vbOKOnly + vbExclamation, "错误"
txtzh.Text = ""
txtzh.SetFocus
Else
If Trim(rs_login.Fields(1)) = Trim(txtmm.Text) Then
rs_login.Close
Unload Me
dlsy.Show
Else
MsgBox "密码输入有误,请重新输入", vbOKOnly + vbExclamation, "错误"
txtmm.SetFocus
End If
End If
End If
End Sub
Private Sub Form_Load()
Dim conn As New ADODB.Connection
Dim connectionstring As String
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "E:\date\data.mdb;Persist Security Info=False"
conn.Open connectionstring
a = Weekday(Now())
If a = 1 Then
a = "礼拜天"
End If
If a = 2 Then
a = "礼拜一"
End If
If a = 3 Then
a = "礼拜二"
End If
If a = 4 Then
a = "礼拜三"
End If
If a = 5 Then
a = "礼拜四"
End If
If a = 6 Then
a = "礼拜五"
End If
If a = 7 Then
a = "礼拜八"
End If
why.Caption = "欢迎您,今天是" & a
why.ForeColor = RGB(255, 0, 0)
End Sub