?? ts6.frm
字號:
VERSION 5.00
Begin VB.Form ts6
BorderStyle = 1 'Fixed Single
Caption = "清空用戶數(shù)據(jù)"
ClientHeight = 2355
ClientLeft = 45
ClientTop = 330
ClientWidth = 4650
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2355
ScaleWidth = 4650
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "確定"
Height = 375
Left = 2640
TabIndex = 3
Top = 1680
Width = 975
End
Begin VB.CommandButton Command1
Caption = "取消"
Height = 375
Left = 960
TabIndex = 2
Top = 1680
Width = 975
End
Begin VB.Image Image1
Height = 360
Left = 480
Picture = "ts6.frx":0000
Top = 480
Width = 360
End
Begin VB.Label Label2
Caption = "繼續(xù)嗎?"
Height = 255
Left = 1200
TabIndex = 1
Top = 960
Width = 1935
End
Begin VB.Label Label1
Caption = "警告:此操作將清空全部用戶數(shù)據(jù)"
Height = 255
Left = 1200
TabIndex = 0
Top = 480
Width = 2895
End
End
Attribute VB_Name = "ts6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Unload ts6
mainfrm.Enabled = True
'初始化主窗口
mainfrm.guanli.Enabled = True
mainfrm.chaxun.Enabled = True
mainfrm.tongji.Enabled = True
If userid = "admin" Then
mainfrm.xitong.Enabled = True
mainfrm.bdb.Enabled = True
Else
mainfrm.xitong.Enabled = False
mainfrm.bdb.Enabled = False
End If
mainfrm.Command1.Enabled = True
mainfrm.Command2.Enabled = True
mainfrm.Command3.Enabled = True
mainfrm.Command5.Enabled = True
If userid = "admin" Then
mainfrm.Command4.Enabled = True
Else
mainfrm.Command4.Enabled = False
End If
GetStatus "<就緒>"
End Sub
Private Sub Command2_Click()
Dim username As String
Dim password As String
Dim cnn As New ADODB.Connection
Dim local_db As String
Set cnn = New ADODB.Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;" '連接數(shù)據(jù)庫
'刪除用戶
local_db = "delete from 用戶表"
cnn.Execute local_db
username = "admin"
password = "admin"
local_db = "insert into 用戶表(用戶名,密碼)" + _
" values(" + "'" + username + "'," + "'" + password + "')"
cnn.Execute local_db
Unload ts6
MsgBox "用戶數(shù)據(jù)已被全部清空", , "提示"
'初始化主窗口
mainfrm.Enabled = True
mainfrm.guanli.Enabled = True
mainfrm.chaxun.Enabled = True
mainfrm.tongji.Enabled = True
If userid = "admin" Then
mainfrm.xitong.Enabled = True
mainfrm.bdb.Enabled = True
Else
mainfrm.xitong.Enabled = False
mainfrm.bdb.Enabled = False
End If
mainfrm.Command1.Enabled = True
mainfrm.Command2.Enabled = True
mainfrm.Command3.Enabled = True
mainfrm.Command5.Enabled = True
If userid = "admin" Then
mainfrm.Command4.Enabled = True
Else
mainfrm.Command4.Enabled = False
End If
GetStatus "<就緒>"
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -