📄 frm1.frm
字号:
VERSION 5.00
Object = "{B0475000-7740-11D1-BDC3-0020AF9F8E6E}#6.0#0"; "TTF16.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frm1
BorderStyle = 1 'Fixed Single
Caption = "数据同步工具V1.0"
ClientHeight = 7365
ClientLeft = 45
ClientTop = 330
ClientWidth = 10965
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frm1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 7365
ScaleWidth = 10965
StartUpPosition = 3 'Windows Default
Begin VB.CheckBox chkNoConnectD
Caption = "不连接目的数据库"
Height = 255
Left = 9030
TabIndex = 8
ToolTipText = "选择该选项时,输出到SQL脚本将无需连接到目标数据库上"
Top = 6300
Width = 1845
End
Begin VB.CommandButton cmdSelectDest
Caption = "选择..."
Height = 300
Left = 9105
TabIndex = 3
ToolTipText = "打开目标"
Top = 450
Width = 855
End
Begin VB.CommandButton cmdSelectSource
Caption = "选择..."
Height = 300
Left = 9105
TabIndex = 1
ToolTipText = "打开源数据库配置文件"
Top = 90
Width = 855
End
Begin VB.CommandButton cmdSelectSQL
Caption = "选择..."
Height = 300
Left = 7980
TabIndex = 7
ToolTipText = "选择SQL脚本文件名"
Top = 6300
Width = 990
End
Begin VB.TextBox txtSQLFile
Height = 300
Left = 2550
TabIndex = 6
ToolTipText = "输入SQL脚本文件名(全路径)"
Top = 6300
Width = 5400
End
Begin VB.CheckBox chkSQL
Caption = "将操作输出为SQL脚本文件"
Height = 240
Left = 105
TabIndex = 5
ToolTipText = "选择该选项时,输出将写到指定的脚本文件中"
Top = 6345
Width = 2415
End
Begin VB.CommandButton cmdShowErrRecord
Caption = "错误记录"
Height = 300
Left = 8445
TabIndex = 14
ToolTipText = "查看错误记录"
Top = 6675
Width = 1200
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 6735
Top = 3750
End
Begin MSComctlLib.StatusBar sbar
Align = 2 'Align Bottom
Height = 315
Left = 0
TabIndex = 20
Top = 7050
Width = 10965
_ExtentX = 19341
_ExtentY = 556
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 3528
MinWidth = 3528
Key = "starttime"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 3528
MinWidth = 3528
Key = "usetime"
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 12197
Key = "info"
EndProperty
EndProperty
End
Begin MSComDlg.CommonDialog CD1
Left = 5460
Top = 3630
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdDKQTPZ
Caption = "打开配置文件"
Height = 300
Left = 2520
TabIndex = 11
ToolTipText = "选择一个配置列表文件"
Top = 6690
Width = 1410
End
Begin VB.CommandButton cmdClose
Caption = "关闭"
Height = 300
Left = 9660
TabIndex = 15
ToolTipText = "关闭本窗口"
Top = 6675
Width = 1200
End
Begin VB.CommandButton cmdStop
Caption = "停止"
Height = 300
Left = 7230
TabIndex = 13
ToolTipText = "停止操作"
Top = 6690
Width = 1200
End
Begin VB.CommandButton cmdStart
Caption = "开始"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 6015
TabIndex = 12
ToolTipText = "开始复制数据"
Top = 6690
Width = 1200
End
Begin VB.CommandButton cmdChange
Caption = "交换数据库"
Height = 300
Left = 1290
TabIndex = 10
ToolTipText = "交换源数据库和目标数据库,交换后要重新连接数据库"
Top = 6690
Width = 1200
End
Begin VB.CommandButton cmdConnect
Caption = "连接数据库"
Height = 300
Left = 60
TabIndex = 9
ToolTipText = "连接数据库"
Top = 6690
Width = 1200
End
Begin VB.TextBox txtD
Height = 300
Left = 1200
Locked = -1 'True
TabIndex = 2
ToolTipText = "打开目标数据库配置文件"
Top = 435
Width = 7890
End
Begin VB.TextBox txtS
Height = 300
Left = 1200
Locked = -1 'True
TabIndex = 0
Top = 90
Width = 7890
End
Begin TTF160Ctl.F1Book F1
Height = 5400
Left = 75
TabIndex = 4
Top = 810
Width = 10815
_ExtentX = 19076
_ExtentY = 9525
_0 = $"frm1.frx":030A
_1 = $"frm1.frx":0713
_2 = $"frm1.frx":0B1C
_3 = $"frm1.frx":0F25
_4 = $"frm1.frx":132E
_count = 5
_ver = 2
End
Begin VB.Label lblD
Caption = "未连接"
ForeColor = &H00C00000&
Height = 255
Left = 10230
TabIndex = 19
Top = 465
Width = 660
End
Begin VB.Label lblS
Caption = "未连接"
ForeColor = &H00C00000&
Height = 240
Left = 10230
TabIndex = 18
Top = 120
Width = 645
End
Begin VB.Label Label2
Caption = "目标数据库"
Height = 240
Left = 105
TabIndex = 17
Top = 510
Width = 1035
End
Begin VB.Label Label1
Caption = "源数据库"
Height = 240
Left = 105
TabIndex = 16
Top = 120
Width = 1020
End
End
Attribute VB_Name = "frm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mobjDBS As clsDB '指向数据源的 XFDB 对象
Dim mobjDBD As clsDB '指向目标的 XFDB 对象
Dim mstrIniS As String '数据源配置文件
Dim mstrIniD As String '目标数据库配置文件
Dim mdtm_Start As Date '当前操作起始时间
Dim mstrListFile As String '当前打开的配置列表文件
Dim mstrCP As String
Dim mfrmErr As frmErrRecord '错误记录。
Private Type TYPE_FIELDDEFINE
FieldName As String
DataType As String
End Type
Private Sub chkSQL_Click()
If chkSQL.Value = 1 Then
chkNoConnectD.Enabled = True
Else
chkNoConnectD.Value = 0
chkNoConnectD.Enabled = False
End If
End Sub
Private Sub cmdChange_Click()
Dim S As String
S = mstrIniS
mstrIniS = mstrIniD
mstrIniD = S
S = txtS.Text
txtS.Text = txtD.Text
txtD.Text = S
If mobjDBS.Connect Then mobjDBS.Disconnect
If mobjDBD.Connect Then mobjDBD.Disconnect
lblS.Caption = "未连接"
lblD.Caption = "未连接"
End Sub
Private Sub cmdClose_Click()
If cmdStop.Enabled = True Then
cmdStop.Tag = "1"
Exit Sub
End If
Unload Me
End Sub
Private Sub cmdConnect_Click()
lblS.Caption = "未连接"
lblD.Caption = "未连接"
cmdStart.Enabled = False
If gFSO.FileExists(mstrIniS) = False Then
XF_MsgE "还未指定源数据库配置文件!"
Exit Sub
End If
If gFSO.FileExists(mstrIniD) = False Then
XF_MsgE "还未指定目标数据库配置文件!"
Exit Sub
End If
If mobjDBS.Init(mstrIniS) = False Then
XF_ShowErrInfo mobjDBS.ErrInfo, , , "打开源数据库配置文件"
Exit Sub
End If
If mobjDBS.Connect = False Then
XF_ShowErrInfo mobjDBS.ErrInfo, , , "连接源数据库"
Exit Sub
End If
mobjDBS.RecordDisConnect = False
lblS.Caption = "已连接"
If mobjDBD.Init(mstrIniD) = False Then
XF_ShowErrInfo mobjDBS.ErrInfo, , , "打开目标数据库配置文件"
Exit Sub
End If
If chkSQL.Value = 1 And chkNoConnectD.Value = 1 Then
Else
If mobjDBD.Connect = False Then
XF_ShowErrInfo mobjDBS.ErrInfo, , , "连接目标数据库"
Exit Sub
End If
lblD.Caption = "已连接"
mobjDBD.RecordDisConnect = False
End If
cmdStart.Enabled = True
End Sub
Private Sub cmdDKQTPZ_Click()
Dim S As String
On Error GoTo Err1
CD1.CancelError = True
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -