Private Sub cmdOK_Click()
If TxtUser.Text = "" Or TxtPwd.Text = "" Then '判断用户框和密码框是否为空!
MsgBox "用户名或密码不能为空,请返回输入!", vbExclamation + vbOKOnly, "提示!"
Else
Dim User As String
Dim Pwd As String
User = Trim(TxtUser.Text)
Pwd = Trim(TxtPwd.Text)
Dim Conn As New ADODB.Connection
Dim StrSql As String
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data\Hydata.mdb;Persist Security Info=False"
Conn.Open
StrSql = "Select * From Admin Where Admin_User='" & User & "' AND Admin_Pwd='" & Pwd & "'"
Conn.Close
Unload Me
frmMain.Show
End If
End Sub
结果没有显示frmMain 窗体。 为什么?
[此贴子已经被作者于2006-5-15 14:43:42编辑过]