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

📄 form9.frm

📁 这是我自己编写的关于创建和修改自己定义的数据库
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         BorderStyle     =   1  'Fixed Single
         Caption         =   "+5V:12000 误差<=1%      50A   误差<=1%"
         Height          =   600
         Index           =   64
         Left            =   2925
         TabIndex        =   89
         Top             =   3240
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*9.终端遥信功能"
         Height          =   315
         Index           =   65
         Left            =   120
         TabIndex        =   88
         Top             =   3840
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "正常"
         Height          =   315
         Index           =   66
         Left            =   2925
         TabIndex        =   87
         Top             =   3840
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "正确 "
         Height          =   315
         Index           =   67
         Left            =   2925
         TabIndex        =   86
         Top             =   4140
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "#17.高温参数时钟召测正确率"
         Height          =   315
         Index           =   68
         Left            =   120
         TabIndex        =   85
         Top             =   6540
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "#16.冲击电压"
         Height          =   315
         Index           =   69
         Left            =   120
         TabIndex        =   84
         Top             =   6240
         Width           =   2805
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*15.绝缘电阻及绝缘强度"
         Height          =   600
         Index           =   70
         Left            =   120
         TabIndex        =   83
         Top             =   5640
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*14.AT45DB161"
         Height          =   315
         Index           =   71
         Left            =   120
         TabIndex        =   82
         Top             =   5340
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*13.历史数据"
         Height          =   315
         Index           =   72
         Left            =   120
         TabIndex        =   81
         Top             =   5040
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*12.交采数据"
         Height          =   315
         Index           =   73
         Left            =   120
         TabIndex        =   80
         Top             =   4740
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*11.数据、时钟保持"
         Height          =   315
         Index           =   74
         Left            =   120
         TabIndex        =   79
         Top             =   4440
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "*10.供电单位代码终端地址"
         Height          =   315
         Index           =   75
         Left            =   120
         TabIndex        =   78
         Top             =   4140
         Width           =   2800
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "复测充满时电压DC="
         Height          =   315
         Index           =   76
         Left            =   2925
         TabIndex        =   77
         Top             =   7140
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   ">=99%"
         Height          =   315
         Index           =   77
         Left            =   2925
         TabIndex        =   76
         Top             =   6540
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "无破坏性放电"
         Height          =   315
         Index           =   78
         Left            =   2925
         TabIndex        =   75
         Top             =   6240
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "R>=10M欧(正常条件下)1min;2KV不击穿,不闪烁"
         Height          =   600
         Index           =   79
         Left            =   2925
         TabIndex        =   74
         Top             =   5640
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "好"
         Height          =   315
         Index           =   80
         Left            =   2925
         TabIndex        =   73
         Top             =   5340
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "正确"
         Height          =   315
         Index           =   81
         Left            =   2925
         TabIndex        =   72
         Top             =   5040
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "正确"
         Height          =   315
         Index           =   82
         Left            =   2925
         TabIndex        =   71
         Top             =   4740
         Width           =   2505
      End
      Begin VB.Label Label7 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "工作正常"
         Height          =   315
         Index           =   83
         Left            =   2925
         TabIndex        =   70
         Top             =   4440
         Width           =   2505
      End
   End
   Begin VB.TextBox Text2 
      Height          =   315
      Index           =   3
      Left            =   9360
      TabIndex        =   9
      Top             =   240
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   315
      Index           =   2
      Left            =   7200
      TabIndex        =   8
      Top             =   240
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   315
      Index           =   1
      Left            =   5040
      TabIndex        =   7
      Top             =   240
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   315
      Index           =   0
      Left            =   2880
      TabIndex        =   3
      Top             =   240
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   315
      Left            =   1200
      TabIndex        =   1
      Top             =   240
      Width           =   1095
   End
   Begin VB.Label Label10 
      Caption         =   "测试日期 "
      Height          =   255
      Left            =   9840
      TabIndex        =   124
      Top             =   7800
      Width           =   1095
   End
   Begin VB.Label Label9 
      Caption         =   "测试人"
      Height          =   255
      Left            =   9840
      TabIndex        =   123
      Top             =   7200
      Width           =   735
   End
   Begin VB.Label Label6 
      Caption         =   "电源电压"
      Height          =   255
      Left            =   8520
      TabIndex        =   6
      Top             =   285
      Width           =   855
   End
   Begin VB.Label Label5 
      Caption         =   "相对湿度"
      Height          =   255
      Left            =   6360
      TabIndex        =   5
      Top             =   285
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "测试温度"
      Height          =   255
      Left            =   4200
      TabIndex        =   4
      Top             =   285
      Width           =   855
   End
   Begin VB.Label Label3 
      Caption         =   "批次"
      Height          =   255
      Left            =   2400
      TabIndex        =   2
      Top             =   285
      Width           =   495
   End
   Begin VB.Label Label2 
      Caption         =   "整机编号"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   285
      Width           =   975
   End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim c2, d2, e2, f2, g2, h2, i2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2 As Integer
Dim str As String




Private Sub Command1_Click()
'Text1.Text = ""
For c2 = 0 To 66
Text2(c2) = ""
Next c2
End Sub

Private Sub Command2_Click()
Dim db As Database
Dim rec As Recordset
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
Set rec = db.OpenRecordset("select 整机编号 from  ceshi  where 整机编号 = '" & Text1.Text & " ' ")

If Text1.Text = "" Then
    o2 = MsgBox("请输入编号", 0, "提示")
Else
    If rec.RecordCount = 0 Then
        str = "insert into ceshi ("
        str = str & "整机编号,批次,测试温度,相对湿度,电源电压,"
        For p2 = 4 To 64
            str = str & "测试" & p2 & ","
        Next p2
        str = str & "测试人,测试日期"
        str = str & ")"
        str = str & " values("
        str = str & "'" & Text1.Text & "',"
        For q2 = 0 To 65
            str = str & "'" & Text2(q2).Text & "',"
        Next q2
        
        str = str & "'" & Text2(66).Text & "'"
        str = str & ") "
        db.Execute (str)
    Else
        r2 = MsgBox("是否覆盖以前的记录", 4, "提示")
        If r2 = 6 Then
            Set rec = db.OpenRecordset("select * from  ceshi  where 整机编号 = '" & Text1.Text & " ' ")
            db.Execute "update ceshi set 批次 = '" & Text2(0).Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
            db.Execute "update ceshi set 测试温度 = '" & Text2(1).Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
            db.Execute "update ceshi set 相对湿度 = '" & Text2(2).Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
            db.Execute "update ceshi set 电源电压 = '" & Text2(3).Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
            For s2 = 4 To 64
                db.Execute "update ceshi set 测试" & s2 & " = '" & Text2(s2).Text & "' where 整机编号 = '" & rec.Fields("整机编号") & "'"
            Next s2
            db.Execute "update ceshi set 测试人 = '" & Text2(65).Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
            db.Execute "update ceshi set 测试日期 = '" & Text2(66).Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"

        End If
    End If
End If
rec.Close
Set rec = Nothing
'Text1.Text = ""
For t2 = 0 To 66
Text2(t2).Text = ""
Next t2
End Sub

Private Sub Command3_Click()
Dim db As Database
Dim rec As Recordset
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
Set rec = db.OpenRecordset("select * from  ceshi  where  整机编号 = '" & Text1.Text & " ' ")
If Text1.Text = "" Then
    d2 = MsgBox("请输入查询编号", 0, "提示")
Else
    If rec.RecordCount > 0 Then
        Text2(0).Text = gfNullToString(rec.Fields("批次"))
        Text2(1).Text = gfNullToString(rec.Fields("测试温度"))
        Text2(2).Text = gfNullToString(rec.Fields("相对湿度"))
        Text2(3).Text = gfNullToString(rec.Fields("电源电压"))
        For e2 = 4 To 64
        Text2(e2).Text = gfNullToString(rec.Fields("测试" & e2))
        Next e2
        Text2(65).Text = gfNullToString(rec.Fields("测试人"))
        Text2(66).Text = gfNullToString(rec.Fields("测试日期"))
    Else
        'Text1.Text = ""
        For f2 = 0 To 66
        Text2(f2) = ""
        Next f2
        i2 = MsgBox("序号不存在,请重新输入", 0, "提示")
    End If
End If
rec.Close
Set rec = Nothing

End Sub

Private Sub Command4_Click()
If Text1.Text = "" Then
    u2 = MsgBox("请输入删除编号,不能为空", 0, "提示")
Else
    Dim db As Database
    Dim rec As Recordset
    Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
    Set rec = db.OpenRecordset("select * from ceshi where 整机编号 ='" & Text1.Text & " ' ")
    If rec.RecordCount > 0 Then
       v2 = MsgBox("确定要删除该记录", 4, "提示")
        If v2 = 6 Then
            'Dim db1 As Database
            'Dim rec1 As Recordset
            'Set db1 = OpenDatabase(App.Path + "\wfk-03.mdb")
            'Set rec1 = db1.OpenRecordset("diantai")
            'db1.Execute ("delete * from jietiaoqiban where 序号 ='" & Text5.Text & " ' ")
            db.Execute ("delete * from ceshi where 整机编号 ='" & Text1.Text & " ' ")
            Text1.Text = ""
            For w2 = 0 To 66
                Text2(w2) = ""
            Next w2
        Else
        End If
    Else
        'Text1.Text = ""
        For x2 = 0 To 66
            Text2(x2).Text = ""
        Next x2
        y2 = MsgBox("编号不存在,请输入要删除的编号", 0, "提示")
    End If
    rec.Close
    Set rec = Nothing
End If

            
            
            
End Sub

Private Sub Command5_Click()
'Text1.Text = ""
For g2 = 0 To 66
Text2(g2) = ""
Next g2
End Sub

Private Sub Command6_Click()
Unload Me
Form1.Show
'Text1.Text = ""
'For h2 = 0 To 66
'Text2(h2) = ""
'Next h2
'Form1.Show
'Form9.Visible = False

End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload Me
Form1.Show
End Sub

⌨️ 快捷键说明

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