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

📄 dlgxfhtesttype.frm

📁 电力机车牵引变压器试验站总控程序
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Begin VB.OptionButton Option1 
            Caption         =   "密封试验"
            Height          =   495
            Index           =   1
            Left            =   2760
            TabIndex        =   38
            Top             =   360
            Width           =   1215
         End
         Begin VB.OptionButton Option1 
            Caption         =   "外观检查"
            Height          =   495
            Index           =   0
            Left            =   360
            TabIndex        =   37
            Top             =   360
            Width           =   1215
         End
      End
      Begin VB.Frame Frame3 
         Caption         =   "基本数据录入"
         Height          =   3495
         Left            =   -74520
         TabIndex        =   16
         Top             =   960
         Width           =   4575
         Begin VB.CommandButton Command11 
            Caption         =   "..."
            Height          =   375
            Left            =   3960
            TabIndex        =   34
            Top             =   2760
            Width           =   375
         End
         Begin VB.TextBox Text1 
            Height          =   495
            Index           =   0
            Left            =   2280
            TabIndex        =   20
            Top             =   480
            Width           =   1575
         End
         Begin VB.TextBox Text1 
            Height          =   495
            Index           =   1
            Left            =   2280
            TabIndex        =   19
            Top             =   1200
            Width           =   1575
         End
         Begin VB.TextBox Text1 
            Height          =   495
            Index           =   2
            Left            =   2280
            TabIndex        =   18
            Top             =   1920
            Width           =   1575
         End
         Begin VB.TextBox Text1 
            Height          =   495
            Index           =   3
            Left            =   2280
            TabIndex        =   17
            Top             =   2640
            Width           =   1575
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            Caption         =   "变压器型号"
            Height          =   195
            Left            =   600
            TabIndex        =   24
            Top             =   480
            Width           =   900
         End
         Begin VB.Label Label2 
            AutoSize        =   -1  'True
            Caption         =   "变压器编号"
            Height          =   195
            Left            =   600
            TabIndex        =   23
            Top             =   1320
            Width           =   900
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "试验员"
            Height          =   195
            Left            =   600
            TabIndex        =   22
            Top             =   2040
            Width           =   540
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            Caption         =   "试验日期"
            Height          =   195
            Left            =   600
            TabIndex        =   21
            Top             =   2880
            Width           =   720
         End
      End
      Begin VB.CommandButton Command1 
         Caption         =   "保存试验数据"
         Enabled         =   0   'False
         Height          =   495
         Left            =   -68760
         TabIndex        =   15
         Top             =   6120
         Width           =   1455
      End
      Begin VB.CommandButton Command2 
         Caption         =   "开始试验"
         Height          =   495
         Left            =   -68760
         TabIndex        =   14
         Top             =   5520
         Width           =   1455
      End
      Begin VB.CommandButton Command5 
         Caption         =   "试验开始"
         Height          =   495
         Left            =   6360
         TabIndex        =   13
         Top             =   5520
         Width           =   1215
      End
      Begin VB.CommandButton Command6 
         Caption         =   "保存数据"
         Enabled         =   0   'False
         Height          =   495
         Left            =   6360
         TabIndex        =   12
         Top             =   6120
         Width           =   1215
      End
      Begin VB.Frame Frame6 
         Caption         =   "基本数据录入"
         Height          =   3495
         Left            =   1680
         TabIndex        =   3
         Top             =   840
         Width           =   4575
         Begin VB.CommandButton Command12 
            Caption         =   "..."
            Height          =   375
            Left            =   3960
            TabIndex        =   35
            Top             =   2760
            Width           =   375
         End
         Begin VB.TextBox Text3 
            Height          =   495
            Index           =   0
            Left            =   2280
            TabIndex        =   7
            Top             =   480
            Width           =   1575
         End
         Begin VB.TextBox Text3 
            Height          =   495
            Index           =   1
            Left            =   2280
            TabIndex        =   6
            Top             =   1200
            Width           =   1575
         End
         Begin VB.TextBox Text3 
            Height          =   495
            Index           =   2
            Left            =   2280
            TabIndex        =   5
            Top             =   1920
            Width           =   1575
         End
         Begin VB.TextBox Text3 
            Height          =   495
            Index           =   3
            Left            =   2280
            TabIndex        =   4
            Top             =   2640
            Width           =   1575
         End
         Begin VB.Label Label9 
            AutoSize        =   -1  'True
            Caption         =   "变压器型号"
            Height          =   195
            Left            =   600
            TabIndex        =   11
            Top             =   480
            Width           =   900
         End
         Begin VB.Label Label10 
            AutoSize        =   -1  'True
            Caption         =   "变压器编号"
            Height          =   195
            Left            =   600
            TabIndex        =   10
            Top             =   1320
            Width           =   900
         End
         Begin VB.Label Label11 
            AutoSize        =   -1  'True
            Caption         =   "试验员"
            Height          =   195
            Left            =   600
            TabIndex        =   9
            Top             =   2040
            Width           =   540
         End
         Begin VB.Label Label12 
            AutoSize        =   -1  'True
            Caption         =   "试验日期"
            Height          =   195
            Left            =   600
            TabIndex        =   8
            Top             =   2880
            Width           =   720
         End
      End
      Begin VB.Image Image1 
         BorderStyle     =   1  'Fixed Single
         Height          =   2250
         Index           =   1
         Left            =   13920
         Picture         =   "dlgXFHTesttype.frx":20D8
         Top             =   960
         Width           =   4560
      End
      Begin VB.Image Image1 
         BorderStyle     =   1  'Fixed Single
         Height          =   2250
         Index           =   0
         Left            =   -60720
         Picture         =   "dlgXFHTesttype.frx":4B03
         Top             =   1080
         Width           =   4560
      End
   End
   Begin VB.CommandButton CancelButton 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   9720
      TabIndex        =   1
      Top             =   14520
      Width           =   1215
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "OK"
      Height          =   375
      Left            =   6960
      TabIndex        =   0
      Top             =   14520
      Width           =   1215
   End
End
Attribute VB_Name = "dlgXFHTesttype"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Private Sub Command1_Click()
    ProgressBar4.Visible = True
    Frame8.Visible = True
    Call saveXFHWord
    
    Dim cn As Object
    Dim rs As Object

    Dim i As Integer
    Dim Y As Integer
    Dim x As Integer
    
    Set cn = CreateObject("adodb.connection")
    Set rs = CreateObject("adodb.recordset")
    cn.ConnectionString = "uid=admin;pwd=111;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "\试验结果1.mdb;Persist Security Info=False"
    cn.Open
    rs.CursorLocation = 3

    rs.Open "select * from 变压器试验结果1 where 试验日期 like '" & byqData(4) & "'", cn, adOpenKeyset, adLockBatchOptimistic
    
    If rs.Recordcount = 0 Then
        rs.Close
        
        Set cn = CreateObject("adodb.connection")
        Set rs = CreateObject("adodb.recordset")
        cn.ConnectionString = "uid=admin;pwd=111;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "\试验结果1.mdb;Persist Security Info=False"
        cn.Open
        rs.CursorLocation = 3
        
        rs.Open "select * from 变压器试验结果1", cn, adOpenKeyset, adLockBatchOptimistic
        

        x = rs.Fields.count
        If rs.Recordcount <> 0 Then
            rs.MoveLast
        End If
        rs.AddNew
        
        For i = 0 To x - 1
           rs.Fields(i) = byqData(i)
        Next i
        rs.UpdateBatch
        rs.Close
        
        Set cn = CreateObject("adodb.connection")
        Set rs = CreateObject("adodb.recordset")
        cn.ConnectionString = "uid=admin;pwd=111;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "\试验结果1.mdb;Persist Security Info=False"
        cn.Open
        rs.CursorLocation = 3
        
        rs.Open "select * from 变压器试验结果2", cn, adOpenKeyset, adLockBatchOptimistic

        Y = rs.Fields.count
        If rs.Recordcount <> 0 Then
            rs.MoveLast
        End If
        rs.AddNew
        For i = 0 To 4
            rs.Fields(i) = byqData(i)
        Next i
        For i = 5 To Y - 1
            rs.Fields(i) = byqData(i + 234)
        Next i
        rs.UpdateBatch
        rs.Close
        
        Set cn = CreateObject("adodb.connection")
        Set rs = CreateObject("adodb.recordset")
        cn.ConnectionString = "uid=admin;pwd=111;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & App.Path & "\试验结果1.mdb;Persist Security Info=False"
        cn.Open
        rs.CursorLocation = 3
        
        rs.Open "select * from 电抗器试验结果", cn, adOpenKeyset, adLockBatchOptimistic

        Y = rs.Fields.count
        If rs.Recordcount <> 0 Then
            rs.MoveLast
        End If
        rs.AddNew
        
        For i = 0 To 206
            rs.Fields(i) = dkqData(i)
        Next i
        rs.UpdateBatch
        rs.Close
        
        MsgBox "数据存档完毕"
        ProgressBar4.Value = ProgressBar4.Max
        Frame8.Visible = False
        ProgressBar4.Visible = False
     Else
        Dim x1 As Integer
        x1 = MsgBox("数据已存在!是否覆盖?", 4 + 0 + 64, "注意")
        If x1 = 6 Then
            rs.Filter = "试验日期 = '" & byqData(4) & "'"
            rs.Delete
            rs.UpdateBatch
            rs.Close

⌨️ 快捷键说明

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