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

📄 frmsjzddc.frm

📁 本系统可用于医院和专业体检中心的健康体检管理
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form FrmSJZDDC 
   BackColor       =   &H00D3DABC&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "数据字典导出"
   ClientHeight    =   4905
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7065
   Icon            =   "FrmSJZDDC.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4905
   ScaleWidth      =   7065
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      BackColor       =   &H00D3DABC&
      Caption         =   "选择路径"
      Height          =   3945
      Left            =   90
      TabIndex        =   0
      Top             =   90
      Width           =   6855
      Begin VB.DriveListBox Drive1 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   240
         TabIndex        =   3
         Top             =   360
         Width           =   2655
      End
      Begin VB.DirListBox Dir1 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   2790
         Left            =   240
         TabIndex        =   2
         Top             =   1020
         Width           =   2655
      End
      Begin VB.FileListBox File1 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3450
         Left            =   3000
         TabIndex        =   1
         Top             =   360
         Width           =   3615
      End
   End
   Begin XPControls.XPCommandButton cmdCancel 
      Cancel          =   -1  'True
      Height          =   495
      Left            =   4230
      TabIndex        =   4
      Top             =   4260
      Width           =   1245
      _ExtentX        =   2196
      _ExtentY        =   873
      Caption         =   "退 出(&X)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin XPControls.XPCommandButton cmdBackup 
      Height          =   495
      Left            =   1440
      TabIndex        =   5
      Top             =   4260
      Width           =   1245
      _ExtentX        =   2196
      _ExtentY        =   873
      Caption         =   "导 出(&B)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   -30
      Top             =   4110
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
End
Attribute VB_Name = "FrmSJZDDC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdBackup_Click()
    Call ExportDictionary_Old(Me.CommonDialog1)
End Sub

Private Sub cmdCancel_Click()
    Unload Me
    
End Sub

Private Sub Dir1_Change()
    File1.Path = Dir1.Path
End Sub

Private Sub Dir1_Click()
    Dir1.Path = Dir1.List(Dir1.ListIndex)
End Sub

Private Sub Dir1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "选择路径"
End Sub

Private Sub Drive1_Change()
On Error Resume Next
    Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "选择文件"
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "Ready"
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ShowStatus "Ready"
    
'    Me.Hide
'    Set frmRestoreAndBackup = Nothing
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "选择路径"
End Sub

'数据字典导出
Private Sub ExportDictionary_Old(ByRef dlgCommonDialog As CommonDialog)
On Error GoTo ErrMsg
    Dim fsoOut As New Scripting.FileSystemObject
    Dim TxtStream As Scripting.TextStream
    Dim strOutFileName As String
    Dim Status
    Dim i, j, K As Integer
    Dim strSQL As String
    Dim strTempResult As String
    Dim strPath As String
    
    Dim rsKS As ADODB.Recordset
    Dim rsDX As ADODB.Recordset
    Dim rsXX As ADODB.Recordset
    Dim rsDic As ADODB.Recordset
    
    Screen.MousePointer = vbHourglass
    
    strOutFileName = GetFileName(dlgCommonDialog, "文本文件(*.txt)|*.txt", _
            "另存为", "BTTJ_数据字典导出文件.txt", WRITEFILE)
    If strOutFileName = "" Then GoTo ExitLab
    
    If MsgBox("确实要导出数据字典到文件“" & strOutFileName & "吗?", _
            vbQuestion + vbYesNo + vbDefaultButton2, "询问") = vbNo Then
        GoTo ExitLab
    End If
    
    Set TxtStream = fsoOut.CreateTextFile(strOutFileName, True, True)
    '执行导出操作
    TxtStream.WriteLine Space(30) & "数据字典导出结果"
    TxtStream.WriteLine
    
    Set rsKS = New ADODB.Recordset
    rsKS.Open "select * from SET_KSSZ order by SXH", GCon, adOpenStatic, adLockReadOnly
    If rsKS.RecordCount > 0 Then
        rsKS.MoveFirst
        Do While Not rsKS.EOF
            '科室
            TxtStream.WriteLine "****************" & rsKS("KSMC") & "****************"
            Set rsDX = New ADODB.Recordset
            strSQL = "SELECT * FROM SET_DX where KSID='" & rsKS("KSID") & "' order by SXH"
            rsDX.Open strSQL, GCon, adOpenStatic, adLockReadOnly
            If rsDX.RecordCount > 0 Then
                rsDX.MoveFirst
                For i = 1 To rsDX.RecordCount
                    If rsDX("DXSFYZX") = 1 Then       '该大项有子项
                        '组合
                        TxtStream.WriteLine "***项目组合(" & rsDX("DXMC") & ")***"
                        Set rsXX = New ADODB.Recordset
                        strSQL = "select * from SET_XX" _
                                & " where XXID in (" _
                                    & "select XXID from SET_ZH_Data" _
                                    & " where DXID='" & rsDX("DXID") & "'" _
                                & ")" _
                                & " order by SXH"
                        rsXX.Open strSQL, GCon, adOpenStatic, adLockReadOnly
                        If rsXX.RecordCount > 0 Then
                            rsXX.MoveFirst
                            For j = 1 To rsXX.RecordCount
                                strTempResult = rsXX("XXMC") & "数据字典设置:"
                                Set rsDic = New ADODB.Recordset
                                strSQL = "select * from DM_XX where XXID='" & rsXX("XXID") & "' order by XXDMID"
                                rsDic.Open strSQL, GCon, adOpenStatic, adLockReadOnly
                                If rsDic.RecordCount > 0 Then
                                    rsDic.MoveFirst
                                    Do While Not rsDic.EOF
                                        strTempResult = strTempResult & rsDic("DMValue") & ","
                                        rsDic.MoveNext
                                    Loop
                                    strTempResult = Mid(strTempResult, 1, Len(strTempResult) - 1) & "。"
                                    TxtStream.Write FormatStrN(strTempResult, 40) & vbCrLf
                                End If
                                rsXX.MoveNext
                            Next j
                        End If
                    Else        '该大项无子项
                        strTempResult = "大项(" & rsDX("DXMC") & ")数据字典设置:"
                        Set rsDic = New ADODB.Recordset
                        strSQL = "select * from DM_DX where DXID='" & rsDX("DXID") & "' order by DXDMID"
                        rsDic.Open strSQL, GCon, adOpenStatic, adLockReadOnly
                        If rsDic.RecordCount > 0 Then
                            rsDic.MoveFirst
                            Do While Not rsDic.EOF
                                strTempResult = strTempResult & rsDic("DMValue") & ","
                                rsDic.MoveNext
                            Loop
                            strTempResult = Mid(strTempResult, 1, Len(strTempResult) - 1) & "。"
                            TxtStream.Write FormatStrN(strTempResult, 40) & vbCrLf
                            TxtStream.WriteLine
                        End If
                    End If
                    rsDX.MoveNext
                Next i
            End If
            TxtStream.WriteLine
            TxtStream.WriteLine
            rsKS.MoveNext
        Loop
    End If
    
    TxtStream.Close
    Set TxtStream = Nothing
    Set fsoOut = Nothing
    MsgBox "已保存完毕", vbInformation, "成功"
         
    GoTo ExitLab
ErrMsg:
    MsgBoxW Err
ExitLab:
    Screen.MousePointer = vbDefault
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -