|
作者: kennychen [kennychen] 论坛用户 | 登录 |
这是一段用户登录界面的代码,运行时系统指出下面if mrc.EOF=True Then代码未定义,请问应该怎么修改?! Private Sub cmdOK_Click() Dim txtSQL As String Dim mrc As ADODB.Recordset Dim MsgText As String UserName = "" If Trim(txtUserName.Text = "") Then MsgBox "用户名错误,请重新输入用户名!", vbOKOnly + vbExclamation, "警告" txtUserName.SetFocus Else txtSQL = "select*from user_Info whereuser_ID="" & txtUserName.Text&"""Set mrc = ExecuteSQL(txtSQL, MsgText) If mrc.EOF = True Then MsgBox "用户名错误,请重新输入用户名!", vbOKOnly + vbExclamation, "警告" txtUserName.SetFocus Else If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then OK = True mrc.Close Me.Hide UserName = Trim(txtUserName.Text) Else MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告" txtPassword.SetFocus txtPassword.Text = "" End If End If End If miCount = miCount + 1 If miCount = 3 Then Me.Hide End If Exit Sub End Sub |
地主 发表时间: 03/02 14:22 |
回复: fanyhoo [fanyhoo] 论坛用户 | 登录 |
代码未定义,可能是数据库链接错误。 |
B1层 发表时间: 03/02 21:21 |
回复: kennychen [kennychen] 论坛用户 | 登录 |
问题就是该怎样解决与数据库的连接问题,我把VB与SQL已用ODBC连接起来,可是还是没用啊!! |
B2层 发表时间: 03/02 23:38 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号