【正文】
. = False . = . = . = . = = Date . = False End With End Sub Private Sub cmddelete_Click() If True And True Then With If MsgBox( 確認要刪除當前記錄嗎? , vbYesNo + vbQuestion + vbDefaultButton2, 確認框 ) = vbYes Then .Find 房間號 = amp。 39。 amp。, , adSearchForward, 1 If Not Then strusername = !姓名 3 strpassword = !密碼 Else strusername = strpassword = End IIf strusername = And strpassword = Then Unload Me Else MsgBox 用戶名或密碼不對! , vbOKOnly + vbInformation, 提示 intlogintimes = intlogintimes + 1 If intlogintimes = 3 Then End End If SendKeys {HOME}+{END} End If End Sub Private Sub cmdcancel_click() Unload Me End Sub Private Sub Command1_Click() opentable adousers, usersinfo With Dim i As Integer If Trim(Text1(0).Text) = Then MsgBox 用戶名不能為空! , vbExclamation + vbOKOnly, 警告 Text1(0).SetFocus Exit Sub End If If Trim(Text1(1).Text) = Then 4 MsgBox 密碼不能為空! , vbExclamation + vbOKOnly, 警告 Text1(1).SetFocus Exit Sub End If If Trim(Text1(2).Text) = Then MsgBox 確認密碼不能為空! , vbExclamation + vbOKOnly, 警告 Text1(2).SetFocus Exit Sub End If If Trim(Text1(1).Text) Trim(Text1(2).Text) Then MsgBox 確認密碼不正確! , vbExclamation + vbOKOnly, 警告 Text1(2).SetFocus Exit Sub End If opentable adousers, usersinfo 姓名 = amp。 amp。 39。逐一判斷字符的合格化 If a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub 2 ElseIf a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = ~ Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = , Then MsgBox Error, vbOKOnly, Error Exit Sub ElseIf a(i) = 39。首先要對用戶名特殊字符的過濾 39。 / .CommandType = adCmdUnknown .RecordSource = precordsource .Refresh End With End Sub Private Sub cmdok_Click() 39。Data Source= amp。 1 本系統(tǒng)設(shè)計過程中,創(chuàng)建一個通用函數(shù)模塊,用于實現(xiàn)數(shù)據(jù)庫連接及按需要打開一個數(shù)據(jù)表。程序代碼如下: Option Explicit Public Sub opentable(pado As Adodc, precordsource As String) With pado .ConnectionString = Provider=。 amp。檢查正確的密碼 39。防止非授權(quán)用戶的登陸訪問 Dim s1 As String Dim i As Integer Dim j As Integer Dim a(18) As String j = Len() s1 = Dim c As Integer c = 1 For i = 1 To j a(i) = Mid(s1, i, 1) 39。 Then MsgBox Error, vbOKOnly, Error Exit Sub End If c = c + 1 Next i Dim strusername As String Dim strpassword As String Static intlogintimes As Integer If Trim() = Then MsgBox 用戶名不能為空!