📄 sysinitialize.frm
字号:
Call cmtf
End Sub
Private Sub Check6_Click()
Call cmtf
End Sub
Private Sub Check7_Click()
Call cmtf
End Sub
Private Sub Check8_Click()
Call cmtf
End Sub
Private Sub Check9_Click()
Call cmtf
End Sub
Private Sub Command1_Click()
'On Error GoTo Errp
If pbUserPermission <> "系统管理员" Then
MsgBox "您的权限不够,请于系统管理员联系!", vbInformation
Exit Sub
Else
Select Case SSTab1.Tab
Case 0
If MsgBox("确定要执行此步操作吗?", vbYesNo + vbQuestion) = vbYes Then
If UserSeek = "" Then
Screen.MousePointer = 11
GzYue = Format(Month(Date), "0#")
Call sTruInfo
If Check1.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & AA & "]=''"
End If
If Check2.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & CC & "]=0"
End If
If Check3.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & DD & "]=0"
End If
If Check4.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & GG & "]=0"
End If
If Check5.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & HH & "]=0"
End If
If Check6.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & BB & "]=0"
End If
If Check7.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & EE & "]=0"
End If
If Check8.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & FF & "]=0"
End If
If Check9.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.比率1电量=0,用户电费.比率2电量=0,用户电费.比率1电费=0,用户电费.比率2电费=0"
End If
If Check10.Value = 1 Then
NdMd.Execute "DELECT * FROM fpNumber"
End If
NdMd.Close
Screen.MousePointer = 0
Else
Screen.MousePointer = 11
If Check1.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & AA & "]='' Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check2.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & CC & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check3.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & DD & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check4.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & GG & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check5.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & HH & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check6.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & BB & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check7.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & EE & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check8.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.[" & FF & "]=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check9.Value = 1 Then
NdMd.Execute "UPDATE 用户电费 SET 用户电费.比率1电量=0,用户电费.比率2电量=0,用户电费.比率1电费=0,用户电费.比率2电费=0 Where 用户电费.镇村代码='" & UserSeek & "'"
End If
If Check10.Value = 1 Then
NdMd.Execute "DELETE * FROM FpNumber"
End If
NdMd.Close
Screen.MousePointer = 0
End If
MsgBox "数据初始化完毕!", vbInformation
End If
Case 1
If MsgBox("此步操作很危险,确定要执行吗?", vbYesNo + vbQuestion) = vbYes Then
Dim pro As Integer
OpenMdb
On Error GoTo 0
Label2.Visible = True
Screen.MousePointer = 11
Label2.Caption = "正在打开数据,请稍后..."
Label2.Refresh
Label2.Caption = "正在删除乡镇档案..."
Label2.Refresh
NdMd.Execute "Delete * From 乡镇档案"
Label2.Caption = "正在删除系统信息..."
Label2.Refresh
NdMd.Execute "Delete * From 系统信息"
Label2.Caption = "正在删除台变信息..."
Label2.Refresh
NdMd.Execute "Delete * From 村档案"
Label2.Caption = "正在删除用户电费..."
Label2.Refresh
NdMd.Execute "Delete * From 用户电费"
Label2.Caption = "正在删除电价档案..."
Label2.Refresh
'ndmd.Execute "Delete * From 电价档案"
'Label2.Caption = "正在删除口令权限..."
'Label2.Refresh
NdMd.Execute "Delete * From 表计档案"
Label2.Caption = "正在删除表计档案..."
Label2.Refresh
NdMd.Execute "Delete * From 口令权限"
Label2.Caption = "正在删除多表档案..."
Label2.Refresh
NdMd.Execute "Delete * From 操作纪录"
Label2.Caption = "正在删除操作纪录..."
Label2.Refresh
'ndmd.Execute "Delete * From 多价表"
'Label2.Caption = "正在删除调整档案..."
'Label2.Refresh
NdMd.Execute "Delete * From 调整档案"
Label2.Caption = "正在删除银行配置档案..."
Label2.Refresh
NdMd.Execute "Delete * From 银行配置"
Label2.Caption = "正在删除对照表信息..."
Label2.Refresh
NdMd.Execute "Delete * From 对照表"
Label2.Caption = "正在删除临时信息..."
Label2.Refresh
NdMd.Execute "Delete * From SendMdb"
NdMd.Execute "Delete * From Temp0"
NdMd.Execute "Delete * From TempTxt"
Screen.MousePointer = 0
SaveSetting App.EXEName, "SysStart", "Start", "One"
NdMd.Close
DBEngine.CompactDatabase App.Path & "\Data\Eletricity.Mdb", App.Path & "\temp.mdb", , dbEncrypt + dbVersion30
Kill App.Path & "\Data\Eletricity.Mdb"
CopyFile App.Path & "\temp.mdb", App.Path & "\Data\Eletricity.Mdb", True
If FileExists(App.Path & "\temp.mdb") Then
Kill App.Path & "\temp.mdb"
End If
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\RegInfo"
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\Options"
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\PrintSetup"
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\RegPass"
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\SelectPhoto"
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\PriceSetup"
DeleteKey HKEY_CURRENT_USER, "Software\VB and VBA Program Settings\Eps\SysSetup"
Label2.Visible = False
Command1.Visible = False
frmMain.MenuTrueFlase (False)
Command2.Caption = "关闭(&E)"
MsgBox "系统已将所有数据初始化请退出系统,然后重新启动系统!" & Chr(13) & "再次启动系统时将出现向导界面,请用户按向导提示进" & Chr(13) & "行各项数据的正确输入!", vbInformation
Call Command2_Click
'Unload Me
'FatalExit 1
End If
End Select
End If
On Error GoTo 0
Exit Sub
Errp:
Select Case Err.Number
Case 3355
MsgBox "请关闭已打开的库! ", vbCritical
Resume Next
Case Else
MsgBox Err.Description, vbCritical
Resume Next
End Select
End Sub
Private Sub Command2_Click()
On Error Resume Next
If Command2.Caption = "关闭(&E)" Then
MdbR.Close
NdMd.Close
Unload Me
FormQuit.Toolbar1.Enabled = False
FormQuit.Toolbar3.Enabled = False
FormQuit.Toolbar4.Enabled = False
Unload frmMain
Set frmMain = Nothing
Else
Unload Me
End If
End Sub
Private Sub Command3_Click()
Check1.Value = 1
Check2.Value = 1
Check3.Value = 1
Check4.Value = 1
Check5.Value = 1
Check6.Value = 1
Check7.Value = 1
Check8.Value = 1
Check9.Value = 1
Check10.Value = 1
End Sub
Private Sub Command4_Click()
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Check6.Value = 0
Check7.Value = 0
Check8.Value = 0
Check9.Value = 0
Check10.Value = 0
Command1.Enabled = False
End Sub
Private Sub Form_Load()
Label2.Visible = False
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
Command1.Enabled = False
SSTab1.Tab = 0
OpenMdb
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Select Case SSTab1.Tab
Case 0
Call cmtf
Case 1
Command1.Enabled = True
End Select
End Sub
Sub cmtf()
If Check1.Value = 1 Or Check2.Value = 1 Or Check3.Value = 1 Or Check4.Value = 1 Or Check5.Value = 1 Or Check6.Value = 1 Or Check7.Value = 1 Or Check8.Value = 1 Or Check9.Value = 1 Or Check10.Value = 1 Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -