【正文】
ub cmdCancel_Click() OK = False End SubPrivate Sub cmdOK_Click() Dim txtSQL As String Dim mrc As Dim MsgText As String 39。ToDo: create test for correct password 39。check for correct password UserName = If Trim( = ) Then MsgBox 沒有這個(gè)用戶,請(qǐng)重新輸入用戶名!, vbOKOnly + vbExclamation, 警告 Else txtSQL = select * from user_Info where user_ID = 39。 amp。 amp。 39。 Set mrc = ExecuteSQL(txtSQL, MsgText) If = True Then MsgBox 沒有這個(gè)用戶,請(qǐng)重新輸入用戶名!, vbOKOnly + vbExclamation, 警告 Else If Trim((1)) = Trim() Then OK = True UserName = Trim() Else MsgBox 輸入密碼不正確,請(qǐng)重新輸入!, vbOKOnly + vbExclamation, 警告 = End If End If End If miCount = miCount + 1 If miCount = 3 Then End If Exit SubEnd SubPrivate Sub cmdCancel_Click() Unload MeEnd SubPrivate Sub cmdOK_Click() Dim txtSQL As String Dim mrc As Dim MsgText As String If Trim(Text1(0).Text) = Then MsgBox 請(qǐng)輸入用戶名稱!, vbOKOnly + vbExclamation, 警告 Exit Sub Text1(0).SetFocus Else txtSQL = select * from user_Info Set mrc = ExecuteSQL(txtSQL, MsgText) While ( = False) If Trim((0)) = Trim(Text1(0)) Then MsgBox 用戶已經(jīng)存在,請(qǐng)重新輸入用戶名!, vbOKOnly + vbExclamation, 警告 Text1(0).SetFocus Text1(0).Text = Text1(1).Text = Text1(2).Text = Exit Sub Else End If Wend End If If Trim(Text1(1).Text) Trim(Text1(2).Text) Then MsgBox 兩次輸入密碼不一樣,請(qǐng)確認(rèn)!, vbOKOnly + vbExclamation, 警告 Text1(1).SetFocus Text1(1).Text = Text1(2).Text = Exit Sub Else If Text1(1).Text = Then MsgBox 密碼不能為空!, vbOKOnly + vbExclamation, 警告 Text1(1).SetFocus Text1(1).Text = Text1(2).Text = Else (0) = Trim(Text1(0).Text) (1) = Trim(Text1(1).Text) MsgBox 添加用戶成功!, vbOKOnly + vbExclamation, 添加用戶 End If End If End Sub沈 陽(yáng) 大 學(xué)