【正文】
Private Sub cmd_ok_Click() Dim try_times As String Dim sql As String Dim rst As try_times = 0If (Trim() = ) Then MsgBox 請輸入密碼, vbOKOnly + vbExclamation, 提示Else sql = select * from 用戶表 where 用戶名=39。 Set rst = ExecuteSQL(sql, ) If Trim((1)) = Trim() Then If Trim((2)) 管理員 Then = False 39。個人認為密碼輸入錯了才加一,你這樣的話,用戶名錯了也會加一,當然你這里用戶名不會錯是吧,改得多余了 If try_times = 3 Then Unload Me End IfEnd IfEnd SubPrivate Sub Form_Load() Dim i As Integer Dim sql As String Dim rst As sql = select 用戶名 from 用戶表 Set rst = ExecuteSQL(sql, ) For i = 1 To ((0)) Next iEnd Sub主窗體:Private Sub bumenxinxi_Click()Dim sql As StringDim rst As New sql = select * from 用戶表 Set rst = ExecuteSQL(sql, )power = (2)If Trim(power) 管理員 ThenMsgBox 您無權(quán)進行該操作!, vbOKOnly + vbExclamation, 警告ElseIf Trim(power) = 管理員 ThenUnload MeEnd IfEnd IfEnd SubPrivate Sub gangweigongzi_Click()Dim sql As StringDim rst As New sql = select * from 用戶表 Set rst = ExecuteSQL(sql, )power = (2)If Trim(power) 管理員 ThenMsgBox 您無權(quán)進行該操作!, vbOKOnly + vbExclamation, 警告ElseIf Trim(power) = 管理員 ThenUnload MeEnd IfEnd IfEnd SubPrivate Sub jiben_Click()Dim sql As StringDim rst As New sql = select * from 用戶表 Set rst = ExecuteSQL(sql, )power = (2)If Trim(power) 管理員 ThenMsgBox 您無權(quán)進行該操作!, vbOKOnly + vbExclamation, 警告ElseIf Trim(power) = 管理員 ThenUnload MeEnd IfEnd IfEnd SubPrivate Sub yonghushanchu_Click()Dim sql As StringDim rst As New sql = select * from 用戶表 Set rst = ExecuteSQL(sql, )power = (2)If Trim(power) 管理員 ThenMsgBox 您無權(quán)進行該操作!, vbOKOnly + vbExclamation, 警告ElseIf Trim(power) = 管理員 ThenUnload MeEnd IfEnd IfEnd SubPrivate Sub yonghutianjia_Click()Dim sql As StringDim rst As New sql = select * from 用戶表 Set rst = ExecuteSQL(sql, )power = (2)If Trim(power)