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

📄 form10.frm

📁 这是我自己编写的关于创建和修改自己定义的数据库
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Height          =   345
         Index           =   6
         Left            =   6870
         TabIndex        =   58
         Top             =   360
         Width           =   750
      End
      Begin VB.Label Label4 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "4h"
         Height          =   345
         Index           =   0
         Left            =   870
         TabIndex        =   57
         Top             =   360
         Width           =   750
      End
      Begin VB.Label Label4 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "测试人"
         Height          =   345
         Index           =   14
         Left            =   120
         TabIndex        =   56
         Top             =   1800
         Width           =   750
      End
      Begin VB.Label Label4 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "温度"
         Height          =   345
         Index           =   15
         Left            =   120
         TabIndex        =   55
         Top             =   1440
         Width           =   750
      End
      Begin VB.Label Label4 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "2."
         Height          =   345
         Index           =   19
         Left            =   120
         TabIndex        =   54
         Top             =   1080
         Width           =   750
      End
      Begin VB.Label Label4 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "1."
         Height          =   345
         Index           =   20
         Left            =   120
         TabIndex        =   53
         Top             =   720
         Width           =   750
      End
      Begin VB.Label Label4 
         BorderStyle     =   1  'Fixed Single
         Height          =   345
         Index           =   27
         Left            =   120
         TabIndex        =   52
         Top             =   360
         Width           =   750
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "测试项目"
      Height          =   735
      Left            =   3240
      TabIndex        =   13
      Top             =   6480
      Width           =   3495
      Begin VB.Label Label6 
         Caption         =   "1.通迅合格率100%"
         Height          =   255
         Left            =   240
         TabIndex        =   15
         Top             =   360
         Width           =   1935
      End
      Begin VB.Label Label7 
         Caption         =   "2.时钟"
         Height          =   255
         Left            =   2400
         TabIndex        =   14
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.Frame Frame2 
      Height          =   3375
      Left            =   9240
      TabIndex        =   6
      Top             =   1440
      Width           =   1095
      Begin CSCommand.Command Command6 
         Height          =   375
         Left            =   120
         TabIndex        =   7
         Top             =   2640
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         IconAlign       =   0
         Icon            =   "Form10.frx":0000
         Caption         =   "返回"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin CSCommand.Command Command5 
         Height          =   375
         Left            =   120
         TabIndex        =   8
         Top             =   2160
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         IconAlign       =   0
         Icon            =   "Form10.frx":001C
         Caption         =   "刷新"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin CSCommand.Command Command4 
         Height          =   375
         Left            =   120
         TabIndex        =   9
         Top             =   1680
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         IconAlign       =   0
         Icon            =   "Form10.frx":0038
         Caption         =   "删除"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin CSCommand.Command Command3 
         Height          =   375
         Left            =   120
         TabIndex        =   10
         Top             =   1200
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         IconAlign       =   0
         Icon            =   "Form10.frx":0054
         Caption         =   "查询"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin CSCommand.Command Command2 
         Height          =   375
         Left            =   120
         TabIndex        =   11
         Top             =   720
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         IconAlign       =   0
         Icon            =   "Form10.frx":0070
         Caption         =   "保存"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin CSCommand.Command Command1 
         Height          =   375
         Left            =   120
         TabIndex        =   12
         Top             =   240
         Width           =   855
         _ExtentX        =   1508
         _ExtentY        =   661
         IconAlign       =   0
         Icon            =   "Form10.frx":008C
         Caption         =   "新增"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
   End
   Begin VB.TextBox Text2 
      Height          =   405
      Left            =   5760
      TabIndex        =   2
      Top             =   1080
      Width           =   1600
   End
   Begin VB.TextBox Text1 
      Height          =   405
      Left            =   2160
      TabIndex        =   1
      Top             =   1080
      Width           =   1600
   End
   Begin VB.Label Label3 
      Caption         =   "老化开始时间"
      Height          =   255
      Left            =   4200
      TabIndex        =   5
      Top             =   1200
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "序号"
      Height          =   255
      Left            =   1440
      TabIndex        =   4
      Top             =   1200
      Width           =   495
   End
   Begin VB.Label Label1 
      Caption         =   "整机老化记录表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3600
      TabIndex        =   0
      Top             =   360
      Width           =   2295
   End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, q3, r3 As Integer
Dim str As String


Private Sub Command1_Click()
'text1.Text=""
Text2.Text = ""
For c3 = 0 To 75
Text3(c3) = ""
Next c3

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  laohua  where 序号 = '" & Text1.Text & " ' ")

If Text1.Text = "" Then
    h3 = MsgBox("请输入编号", 0, "提示")
Else
    If rec.RecordCount = 0 Then
        str = "insert into laohua ("
        str = str & "序号,老化开始日期,"
        For i3 = 0 To 74
            str = str & "老化" & i3 & ","
        Next i3
        str = str & "老化75"
        str = str & ")"
        str = str & " values("
        str = str & "'" & Text1.Text & "',"
        str = str & "'" & Text2.Text & "',"

        For j3 = 0 To 74
            str = str & "'" & Text3(j3).Text & "',"
        Next j3
        
        str = str & "'" & Text3(75).Text & "'"
        str = str & ") "
        db.Execute (str)
    Else
        k3 = MsgBox("是否覆盖以前的记录", 4, "提示")
        If k3 = 6 Then
            Set rec = db.OpenRecordset("select * from  laohua where 序号 = '" & Text1.Text & " ' ")
            db.Execute "update laohua set 老化开始日期 = '" & Text2.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            For l3 = 0 To 75
                db.Execute "update laohua set 老化" & l3 & " = '" & Text3(l3).Text & "' where 序号 = '" & rec.Fields("序号") & "'"
            Next l3

        End If
    End If
End If
rec.Close
Set rec = Nothing
'Text1.Text = ""
Text2.Text = ""
For m3 = 0 To 75
Text3(m3).Text = ""
Next m3
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  laohua  where  序号 = '" & Text1.Text & " ' ")
If Text1.Text = "" Then
    d3 = MsgBox("请输入查询编号", 0, "提示")
Else
    If rec.RecordCount > 0 Then
        Text2.Text = gfNullToString(rec.Fields("老化开始日期"))

        For e3 = 0 To 75
            Text3(e3).Text = gfNullToString(rec.Fields("老化" & e3))
        Next e3
    Else
        'Text1.Text = ""
        Text2.Text = ""
        For f3 = 0 To 75
        Text3(f3) = ""
        Next f3
        g3 = MsgBox("序号不存在,请重新输入", 0, "提示")
    End If
End If
rec.Close
Set rec = Nothing

End Sub

Private Sub Command4_Click()
If Text1.Text = "" Then
    n3 = 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 laohua where 序号 ='" & Text1.Text & " ' ")
    If rec.RecordCount > 0 Then
       o3 = MsgBox("确定要删除该记录", 4, "提示")
        If o3 = 6 Then
            db.Execute ("delete * from laohua where 序号 ='" & Text1.Text & " ' ")
            Text1.Text = ""
            Text2.Text = ""
            For p3 = 0 To 75
                Text3(p3) = ""
            Next p3
        Else
        End If
    Else
        'Text1.Text = ""
        Text2.Text = ""
        For q3 = 0 To 75
            Text3(q3).Text = ""
        Next q3
        r3 = MsgBox("编号不存在,请输入要删除的编号", 0, "提示")
    End If
    rec.Close
    Set rec = Nothing
End If

End Sub

Private Sub Command5_Click()
'Text1.Text = ""
Text2.Text = ""

For b3 = 0 To 75
Text3(b3) = ""
Next b3
End Sub

Private Sub Command6_Click()
Unload Me
Form1.Show
'Text1.Text = ""
'Text2.Text = ""
'For a3 = 0 To 75
'Text3(a3) = ""
'Next a3
'Form1.Show
'Form10.Visible = False
'Unload Me

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 + -