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

📄 form5.frm

📁 这是我自己编写的关于创建和修改自己定义的数据库
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      TabIndex        =   13
      Top             =   2640
      Width           =   1215
   End
   Begin VB.Label Label7 
      Caption         =   "交流电源"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   11
      Top             =   2520
      Width           =   975
   End
   Begin VB.Label Label6 
      Caption         =   "序号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3120
      TabIndex        =   9
      Top             =   1920
      Width           =   495
   End
   Begin VB.Label Label5 
      Caption         =   "电源电压"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   7
      Top             =   1800
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "相对湿度"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   5640
      TabIndex        =   5
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label3 
      Caption         =   "测试温度"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3000
      TabIndex        =   3
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "批次"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   1
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "WFK-03-JXB2.PCB接线板测试记录表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2640
      TabIndex        =   0
      Top             =   360
      Width           =   5175
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim a1, b1, c1, d1, e1, f1, g1 As Integer
Dim str As String



Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'text5.Text=""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
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("jiexianban")
'rec.AddNew
'rec!批次 = Text1
'rec!测试温度 = Text2
'rec!相对湿度 = Text3
'rec!电源电压 = Text4
'rec.fields("序号") = Text5

'rec!交流电源 = Text6
'rec!直流电源 = Text7
'rec!AD = Text8
'rec!脉冲 = Text9
'rec!接口485 = Text10
'rec!遥信 = Text11
'rec!遥控 = Text12

'rec!备注 = Text13
'rec!测试人 = Text14
'rec!测试日期 = Text15
'rec!检验人 = Text16
'rec!检验日期 = Text17

'rec.Update
'Text1.Text = ""
'Text2.Text = ""
'Text3.Text = ""
'Text4.Text = ""
'Text5.Text = ""
'Text6.Text = ""
'Text7.Text = ""
'Text8.Text = ""
'Text9.Text = ""
'Text10.Text = ""
'Text11.Text = ""
'Text12.Text = ""
'Text13.Text = ""
'Text14.Text = ""
'Text15.Text = ""
'Text16.Text = ""
'Text17.Text = ""
If Text5.Text = "" Then
    d1 = 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 jiexianban where 序号 ='" & Text5.Text & " ' ")
    If rec.RecordCount > 0 Then
       e1 = MsgBox("确定要删除该记录", 4, "提示")
        If e1 = 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 jiexianban where 序号 ='" & Text5.Text & " ' ")
            Text1.Text = ""
            Text2.Text = ""
            Text3.Text = ""
            Text4.Text = ""
            Text5.Text = ""
            Text6.Text = ""
            Text7.Text = ""
            Text8.Text = ""
            Text9.Text = ""
            Text10.Text = ""
            Text11.Text = ""
            Text12.Text = ""
            Text13.Text = ""
            Text14.Text = ""
            Text15.Text = ""
            Text16.Text = ""
          
        Else
        End If
        
    Else
            Text1.Text = ""
            Text2.Text = ""
            Text3.Text = ""
            Text4.Text = ""
            'Text5.Text = ""
            Text6.Text = ""
            Text7.Text = ""
            Text8.Text = ""
            Text9.Text = ""
            Text10.Text = ""
            Text11.Text = ""
            Text12.Text = ""
            Text13.Text = ""
            Text14.Text = ""
            Text15.Text = ""
            Text16.Text = ""
          
        f1 = MsgBox("序号不存在,请输入要删除的序号", 0, "提示")
    End If
    rec.Close
    Set rec = Nothing

End If

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  jiexianban  where 序号 = '" & Text5.Text & " ' ")
If Text5.Text = "" Then
    a1 = MsgBox("请输入查询序号", 0, "提示")
Else
    If rec.RecordCount > 0 Then
        Text1.Text = gfNullToString(rec.Fields("批次"))
        Text2.Text = gfNullToString(rec.Fields("测试温度"))
        Text3.Text = gfNullToString(rec.Fields("相对湿度"))
        Text4.Text = gfNullToString(rec.Fields("电源电压"))
        Text5.Text = gfNullToString(rec.Fields("序号"))
        
        Text6.Text = gfNullToString(rec.Fields("交流电源"))
        Text7.Text = gfNullToString(rec.Fields("直流电源"))
        Text8.Text = gfNullToString(rec.Fields("AD"))
        Text9.Text = gfNullToString(rec.Fields("脉冲"))
        Text10.Text = gfNullToString(rec.Fields("接口485"))
        Text11.Text = gfNullToString(rec.Fields("遥信"))
        Text12.Text = gfNullToString(rec.Fields("遥控"))
        
        Text13.Text = gfNullToString(rec.Fields("备注"))
        Text14.Text = gfNullToString(rec.Fields("测试人"))
        Text15.Text = gfNullToString(rec.Fields("测试日期"))
        Text16.Text = gfNullToString(rec.Fields("检验人"))
        Text17.Text = gfNullToString(rec.Fields("检验日期"))
    Else
            Text1.Text = ""
            Text2.Text = ""
            Text3.Text = ""
            Text4.Text = ""
            'Text5.Text = ""
            Text6.Text = ""
            Text7.Text = ""
            Text8.Text = ""
            Text9.Text = ""
            Text10.Text = ""
            Text11.Text = ""
            Text12.Text = ""
            Text13.Text = ""
            Text14.Text = ""
            Text15.Text = ""
            Text16.Text = ""
        b1 = MsgBox("序号不存在,请重新输入", 0, "提示")
        
    End If
    
End If
rec.Close
Set rec = Nothing

End Sub

Private Sub Command4_Click()
Dim db As Database
Dim rec As Recordset
'Dim str As String
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")

Set rec = db.OpenRecordset("select 序号 from  jiexianban where 序号 = '" & Text5.Text & " ' ")
If Text5.Text = "" Then
    c1 = MsgBox("请输入序号", 0, "提示")
Else
    If rec.RecordCount = 0 Then
        str = "insert into jiexianban("
        str = str & "批次,测试温度,相对湿度,电源电压,序号,交流电源,直流电源,AD,脉冲,接口485,遥信,"
        str = str & "遥控,备注,测试人,测试日期,检验人,检验日期"
        str = str & ")"
        str = str & " values("
        str = str & "'" & Text1.Text & "',"
        str = str & "'" & Text2.Text & "',"
        str = str & "'" & Text3.Text & "',"
        str = str & "'" & Text4.Text & "',"
        str = str & "'" & Text5.Text & "',"
        str = str & "'" & Text6.Text & "',"
        str = str & "'" & Text7.Text & "',"
        str = str & "'" & Text8.Text & "',"
        str = str & "'" & Text9.Text & "',"
        str = str & "'" & Text10.Text & "',"
        str = str & "'" & Text11.Text & "',"
        str = str & "'" & Text12.Text & "',"
        str = str & "'" & Text13.Text & "',"
        str = str & "'" & Text14.Text & "',"
        str = str & "'" & Text15.Text & "',"
        str = str & "'" & Text16.Text & "',"
        str = str & "'" & Text17.Text & "'"
        str = str & ") "
        db.Execute (str)
    Else
        g1 = MsgBox("是否覆盖以前的记录", 4, "提示")
        If g1 = 6 Then

            Set rec = db.OpenRecordset("select * from  jiexianban  where 序号= '" & Text5.Text & " ' ")
           
            db.Execute "update jiexianban set 批次 = '" & Text1.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 测试温度 = '" & Text2.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 相对湿度 = '" & Text3.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 电源电压 = '" & Text4.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            
            db.Execute "update jiexianban set 交流电源 = '" & Text6.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 直流电源 = '" & Text7.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set AD = '" & Text8.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 脉冲 = '" & Text9.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 接口485 = '" & Text10.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 遥信 = '" & Text11.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 遥控 = '" & Text12.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            
            db.Execute "update jiexianban set 备注 = '" & Text13.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 测试人 = '" & Text14.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 测试日期 = '" & Text15.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 检验人 = '" & Text16.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
            db.Execute "update jiexianban set 检验日期 = '" & Text17.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
        Else
        End If
    End If
End If
rec.Close
Set rec = Nothing



Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""



End Sub

Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
End Sub

Private Sub Command6_Click()
Unload Me
Form1.Show
'Form1.Show
'Form5.Visible = False
'Text1.Text = ""
'Text2.Text = ""
'Text3.Text = ""
'Text4.Text = ""
'Text5.Text = ""
'Text6.Text = ""
'Text7.Text = ""
'Text8.Text = ""
'Text9.Text = ""
'Text10.Text = ""
'Text11.Text = ""
'Text12.Text = ""
'Text13.Text = ""
'Text14.Text = ""
'Text15.Text = ""
'Text16.Text = ""
'Text17.Text = ""
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 + -