⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 复件 frmimport.frm

📁 档案管理系统,使用vb6+access数据库开发
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      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 + -