level 5
DanieSimth
楼主
Private Sub cmdOK_Click() Dim mrc As ADODB.Recordset Dim strmsg As String txtSQL = "select uid from userinfo where UID='" & Trim(txtUserName.Text) & "'" Set mrc = ExecuteSQL(txtSQL, strmsg) If mrc.EOF = True Then MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告" txtUserName.SetFocus txtUserName.SelStart = 0 txtUserName.SelLength = Len(txtUserName.Text) Exit Sub End If UserName = mrc.Fields(0) txtSQL = "select UID from userinfo where PWD='" & Trim(txtPassword.Text) & "'" Set mrc = ExecuteSQL(txtSQL, strmsg) If mrc.EOF = True Then MsgBox " 密码错误!", vbExclamation + vbOKOnly, "警告" txtPassword.SetFocus txtPassword.SelStart = 0 txtPassword.SelLength = Len(txtPassword.Text) Exit Sub End If OK = True frmMain.Show Unload Me
2008年08月07日 07点08分
1