您的位置:首页 > 编程语言 > VB

vb27

2016-05-26 17:57 363 查看
Option Explicit

Const mxlogintimes As Integer = 3

Private Sub cmdlogin_Click()

Dim cn As Connection

Dim rs As Recordset

Set cn = New Connection

Set rs = New Recordset

cn.ConnectionString = "provider=microsoft.jet OLEDB.3.51;data source=c:\users\jf\desktop\textexample.mdb"

cn.Open

rs.ActiveConnection = cn

Dim strsql As String

strsql = "select userpassword from userinformation where UserID='" & Me.txtUserID & "'"

rs.Open (strsql)

If rs.EOF Then

MsgBox "用户名不存在", vbCritical, "denglu"

Else

If rs.Fields("userpaddword").Value <> Me.txtuserpassword Then

MsgBox "mimacuo"

Else

MsgBox "success"

Unload Me

Form2.Show

End If

End If

cn.Close

Set cn = Nothing

Set rs = Nothing

ppp:

End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: