发表于:2006/3/26 11:46:00
#0楼
下面一段代码是实现登陆窗口,因刚接触,不知这个密码到底是什么?上怎样实现的?
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim miCount As Integer
Private Sub cmdCancel_Click()
Unload frmLogin
End Sub
Private Sub cmdOK_Click()
Dim i As Integer
txtSQL = "select * from password where code = '" & txtPassword.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
m_passcode = 3
txtPassword.Text = ""
MsgBox "没有这个记录,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
Else
For i = 1 To 6
strpass(i) = Trim(mrc.Fields(i))
Next
Unload Me
frmindex.Show
' frmMain.Show
End If
End Sub
Option Explicit
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Dim txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim miCount As Integer
Private Sub cmdCancel_Click()
Unload frmLogin
End Sub
Private Sub cmdOK_Click()
Dim i As Integer
txtSQL = "select * from password where code = '" & txtPassword.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = True Then
m_passcode = 3
txtPassword.Text = ""
MsgBox "没有这个记录,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
Else
For i = 1 To 6
strpass(i) = Trim(mrc.Fields(i))
Next
Unload Me
frmindex.Show
' frmMain.Show
End If
End Sub