📄 frm_sys_m.frm
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frm_sys_m
Caption = "系统设置"
ClientHeight = 6195
ClientLeft = 4365
ClientTop = 2370
ClientWidth = 8310
Icon = "frm_sys_m.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6195
ScaleWidth = 8310
Begin TabDlg.SSTab SSTab1
Height = 6255
Left = -120
TabIndex = 0
Top = 0
Width = 8445
_ExtentX = 14896
_ExtentY = 11033
_Version = 393216
TabOrientation = 3
Tabs = 2
TabsPerRow = 2
TabHeight = 617
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "@宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
TabCaption(0) = "系统初始化"
TabPicture(0) = "frm_sys_m.frx":0442
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Label5"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "Command5"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Command4(1)"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "Check2"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "Check3"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "Check4"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).Control(6)= "Check5"
Tab(0).Control(6).Enabled= 0 'False
Tab(0).ControlCount= 7
TabCaption(1) = "数据备份与恢复"
TabPicture(1) = "frm_sys_m.frx":045E
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "Text1"
Tab(1).Control(1)= "Check1"
Tab(1).Control(2)= "Command3"
Tab(1).Control(3)= "Command4(0)"
Tab(1).Control(4)= "Command2"
Tab(1).Control(5)= "Command1"
Tab(1).Control(6)= "Text2"
Tab(1).Control(7)= "Label1"
Tab(1).Control(8)= "Label2"
Tab(1).Control(9)= "Label3"
Tab(1).Control(10)= "Label4"
Tab(1).ControlCount= 11
Begin VB.CheckBox Check5
Caption = "教材出库历史表"
Height = 375
Left = 4200
TabIndex = 18
Top = 2160
Width = 1935
End
Begin VB.CheckBox Check4
Caption = "教材入库历史表"
Height = 375
Left = 1440
TabIndex = 17
Top = 2160
Width = 1935
End
Begin VB.CheckBox Check3
Caption = "预订教材表"
Height = 375
Left = 4200
TabIndex = 15
Top = 1200
Width = 1935
End
Begin VB.CheckBox Check2
Caption = "教材表"
Height = 495
Left = 1440
TabIndex = 14
Top = 1080
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Index = 1
Left = 4800
TabIndex = 13
Top = 4560
Width = 975
End
Begin VB.CommandButton Command5
Caption = "确定"
Height = 375
Left = 1920
TabIndex = 12
Top = 4560
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = -72480
TabIndex = 9
Top = 1560
Width = 3135
End
Begin VB.CheckBox Check1
Caption = " 不显示启动画面"
Height = 615
Left = -74160
TabIndex = 6
Top = 240
Width = 1935
End
Begin VB.CommandButton Command3
Caption = "确定"
Height = 375
Left = -73080
TabIndex = 5
Top = 4680
Width = 855
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Index = 0
Left = -69480
TabIndex = 4
Top = 4680
Width = 855
End
Begin VB.CommandButton Command2
Caption = "恢复"
Enabled = 0 'False
Height = 375
Left = -69000
TabIndex = 3
Top = 3120
Width = 855
End
Begin VB.CommandButton Command1
Caption = "备份"
Height = 375
Left = -69000
TabIndex = 2
Top = 1680
Width = 855
End
Begin VB.TextBox Text2
Height = 495
Left = -72360
TabIndex = 1
Top = 3000
Width = 3135
End
Begin VB.Label Label5
Caption = "请选择要初始化的基本表:"
Height = 375
Left = 360
TabIndex = 16
Top = 360
Width = 2295
End
Begin VB.Label Label1
Caption = "数据备份:"
Height = 375
Left = -74640
TabIndex = 11
Top = 1320
Width = 975
End
Begin VB.Label Label2
Caption = "保存路径:"
Height = 495
Left = -73680
TabIndex = 10
Top = 1680
Width = 975
End
Begin VB.Label Label3
Caption = "数据恢复"
Height = 615
Left = -74640
TabIndex = 8
Top = 2640
Width = 855
End
Begin VB.Label Label4
Caption = "文件所在路径:"
Height = 615
Left = -73680
TabIndex = 7
Top = 3120
Width = 1335
End
End
End
Attribute VB_Name = "frm_sys_m"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cncer1 As ADODB.Connection
Dim rscer1 As ADODB.Recordset
Dim Trim1 As String
Dim write_pre As preference_type
Dim record_no_pre As Integer
Private Sub Check1_Click()
If Check1.Value = 1 Then
With write_pre
.splash_switch = 0
End With
ElseIf Check1.Value = 0 Then
With write_pre
.splash_switch = 1
End With
End If
End Sub
Private Sub Command1_Click()
Dim fmdlsql1 As String
Trim1 = Trim(Text1.Text)
If Trim1 = "" Then
MsgBox "请输入路径!", vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
Set rscer1 = New ADODB.Recordset
fmdlsql1 = "backup database 通用教材管理系统 to disk='" & Text1.Text & "'"
rscer1.Open fmdlsql1, cncer1, adOpenDynamic, adLockBatchOptimistic
MsgBox "备份成功!", vbOKOnly
End Sub
Private Sub Command2_Click()
Dim fmdlsql1 As String
Trim1 = Trim(Text2.Text)
If Trim1 = "" Then
MsgBox "请输入路径!", vbOKOnly, "警告"
Text2.SetFocus
Exit Sub
End If
Set rscer1 = New ADODB.Recordset
fmdlsql1 = "restore DATABASE 通用教材管理系统 from disk='" & Text2.Text & "'"
rscer1.Open fmdlsql1, cncer1, adOpenDynamic, adLockOptimistic
MsgBox "恢复成功!", vbOKOnly
End Sub
Private Sub Command3_Click()
Open App.Path + "\preference.conf" For Random As #1 Len = Len(write_pre)
record_no_pre = LOF(1) / Len(write_pre)
Put #1, record_no_pre, write_pre
Close #1
Unload Me
End Sub
Private Sub Command4_Click(Index As Integer)
Unload Me
frm_mainconsole.Show
End Sub
Private Sub Command5_Click()
Dim fmdlsql1 As String
If Check2.Value = 1 Then
Set rscer1 = New ADODB.Recordset
fmdlsql1 = "delete from 教材表"
rscer1.Open fmdlsql1, cncer1, adOpenDynamic, adLockBatchOptimistic
End If
If Check3.Value = 1 Then
Set rscer1 = New ADODB.Recordset
fmdlsql1 = "delete from 预订教材表"
rscer1.Open fmdlsql1, cncer1, adOpenDynamic, adLockBatchOptimistic
End If
If Check4.Value = 1 Then
Set rscer1 = New ADODB.Recordset
fmdlsql1 = "delete from 教材入库历史表"
rscer1.Open fmdlsql1, cncer1, adOpenDynamic, adLockBatchOptimistic
End If
If Check5.Value = 1 Then
Set rscer1 = New ADODB.Recordset
fmdlsql1 = "delete from 教材出库历史表"
rscer1.Open fmdlsql1, cncer1, adOpenDynamic, adLockBatchOptimistic
End If
MsgBox "初始化成功"
End Sub
Private Sub Form_Load()
Set cncer1 = New ADODB.Connection
cncer1.ConnectionString = "FileDSN=通用教材管理系统.dsn;UID=sa;PWD="
cncer1.Open
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -