?? 復件 frmimport.frm
字號:
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 1
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 5
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=PmData"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "PmData"
OtherAttributes = ""
UserName = "Admin"
Password = ""
RecordSource = "DataG"
Caption = "歸檔文件"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc adoDBF
Height = 312
Left = 7080
Top = 3960
Visible = 0 'False
Width = 960
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 3
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 1
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 5
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dBASE Files"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dBASE Files"
OtherAttributes = ""
UserName = "Admin"
Password = ""
RecordSource = ""
Caption = "DBF文件"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc adoDA
Height = 312
Left = 120
Top = 3720
Visible = 0 'False
Width = 960
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 3
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 1
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 5
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=PmData"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "PmData"
OtherAttributes = ""
UserName = "Admin"
Password = ""
RecordSource = "DataA"
Caption = "案卷檔案"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc adoDW
Height = 312
Left = 120
Top = 3360
Visible = 0 'False
Width = 960
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 3
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 2
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 5
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=PmData"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "PmData"
OtherAttributes = ""
UserName = "Admin"
Password = ""
RecordSource = "DataW"
Caption = "卷內文件"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc adoDP
Height = 312
Left = 120
Top = 4080
Visible = 0 'False
Width = 960
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 3
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 1
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 5
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=PmData"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "PmData"
OtherAttributes = ""
UserName = "Admin"
Password = ""
RecordSource = "DataP"
Caption = "照片檔案"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label labelDIR
AutoSize = -1 'True
Caption = "DBF文件的存放目錄(文件夾)"
Height = 216
Left = 480
TabIndex = 20
Top = 2700
Width = 2700
End
End
Attribute VB_Name = "frmImport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim adoCon, adoDBFCon As ADODB.Connection
Dim adoDBFRst, adoRst, adoZRst As ADODB.Recordset
Dim choseFile As Integer '設定選擇檔案類別的個數
Dim FileLevel As Integer '設定檔案級別:文件、案卷、歸檔文件
Dim TabelFile, DbfFile As String
Private Function ConvertNull(para_Value As Variant) As Variant
If IsNull(para_Value) = True Then
ConvertNull = ""
Else
ConvertNull = para_Value
End If
End Function
Private Sub chkFT_Click(Index As Integer)
If chkFT(Index).Value = 1 Then
choseFile = choseFile + 1
Else
choseFile = choseFile - 1
End If
If choseFile = 14 Then cmdALL.Enabled = False Else cmdALL.Enabled = True
cmdClear.Enabled = choseFile
cmdGO.Enabled = choseFile
End Sub
Private Sub cmdALL_Click()
Dim i As Integer
For i = 0 To 13
chkFT(i).Value = 1
Next
cmdALL.Enabled = False
cmdClear.Enabled = True
End Sub
Private Sub cmdClear_Click()
Dim i As Integer
For i = 0 To 13
chkFT(i).Value = 0
Next
cmdALL.Enabled = True
cmdClear.Enabled = False
chkFT(0).SetFocus
End Sub
Private Sub cmdGO_Click()
Call Import '調用導入主模塊
End Sub
Private Sub Import()
'導入主模塊
Dim i, FileNum As Integer
Dim cFiles, LevelName, arrFile() As String
FileNum = 0
LevelName = IIf(FileLevel = 0, "文件", IIf(FileLevel = 1, "案卷", "NPF"))
For i = 0 To 13
If chkFT(i).Value = 1 Then
If cFiles = "" Then
cFiles = Left$(chkFT(i).Caption, 2)
Else
cFiles = cFiles & "," & Left$(chkFT(i).Caption, 2)
End If
FileNum = FileNum + 1
End If
Next
If FileNum = 0 Then
chkFT(0).SetFocus
Exit Sub
End If
txtMsg.Text = "正在導入檔案 ......"
arrFile = Split(cFiles, ",")
If Right(TextDIR.Text, 1) <> "\" Then TextDIR.Text = TextDIR.Text & "\"
For i = 0 To FileNum - 1
DbfFile = TextDIR.Text & LevelName
If FileLevel = 2 Then '用戶選定了歸檔文件
If Not CheckFile(DbfFile & ".DBF") Then
MsgBox "文件 " & DbfFile & ".DBF 不存在"
Exit For
End If
DbfFile = DbfFile & " Where ProFiles='" & arrFile(i) & "'"
TabelFile = "DataG"
Else
DbfFile = DbfFile & arrFile(i)
If Not CheckFile(DbfFile & ".DBF") Then
MsgBox "文件 " & DbfFile & ".DBF 不存在"
Exit For
End If
TabelFile = IIf(FileLevel = 1, "DataA", IIf(arrFile(i) = "照片", "DataP", "DataW"))
End If
DbfFile = "Select * From " & DbfFile
If FileLevel = 0 Then
If arrFile(i) = "照片" Then
TabelFile = "Select * From " & TabelFile & " Where FileType='" & arrFile(i) & "' Order By 檔號, 順序號, FileType, 照片號"
Else
TabelFile = "Select * From " & TabelFile & " Where FileType='" & arrFile(i) & "' Order By 檔號, 頁號"
End If
Else
TabelFile = "Select * From " & TabelFile & " Where FileType='" & arrFile(i) & "' Order By 檔號"
End If
Call CopyFile(arrFile(i))
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -