📄 form4.frm
字号:
Left = 3000
TabIndex = 34
Top = 360
Width = 975
End
Begin VB.Label Label9
Alignment = 2 'Center
Caption = "测试日期(yyyy-mm-dd)"
Height = 375
Index = 0
Left = 1200
TabIndex = 25
Top = 360
Width = 1215
End
End
Begin VB.OptionButton Option2
Caption = "数据修改"
Height = 375
Left = -69600
TabIndex = 22
Top = 2880
Width = 1815
End
Begin VB.OptionButton Option1
Caption = "数据查询"
Height = 375
Left = -72120
TabIndex = 21
Top = 2880
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = -69000
TabIndex = 19
Top = 6240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "修改入库"
Height = 495
Left = -72600
TabIndex = 18
Top = 6240
Width = 1455
End
Begin VB.Frame Frame5
Caption = "修改数据库数据"
Height = 2535
Left = -74520
TabIndex = 1
Top = 3360
Width = 8775
Begin VB.TextBox Text8
Alignment = 2 'Center
DataField = "抑制率"
DataSource = "Adodc1"
Height = 375
Left = 6240
TabIndex = 9
Text = "Text8"
Top = 1800
Width = 1215
End
Begin VB.TextBox Text7
Alignment = 2 'Center
DataField = "吸光度"
DataSource = "Adodc1"
Height = 375
Left = 4560
TabIndex = 8
Text = "Text7"
Top = 1800
Width = 1215
End
Begin VB.TextBox Text6
Alignment = 2 'Center
DataField = "透光度"
DataSource = "Adodc1"
Height = 375
Left = 2880
TabIndex = 7
Text = "Text6"
Top = 1800
Width = 1215
End
Begin VB.TextBox Text5
Alignment = 2 'Center
DataField = "类别"
DataSource = "Adodc1"
Height = 375
Left = 1200
TabIndex = 6
Text = "Text5"
Top = 1800
Width = 1215
End
Begin VB.TextBox Text4
Alignment = 2 'Center
DataField = "产地"
DataSource = "Adodc1"
Height = 375
Left = 6240
TabIndex = 5
Text = "Text4"
Top = 720
Width = 1215
End
Begin VB.TextBox Text3
Alignment = 2 'Center
DataField = "样品号"
Height = 375
Left = 4560
TabIndex = 4
Text = "Text3"
Top = 720
Width = 1215
End
Begin VB.TextBox Text2
Alignment = 2 'Center
DataField = "检测时间"
Height = 375
Left = 2880
TabIndex = 3
Text = "Text2"
Top = 720
Width = 1215
End
Begin VB.TextBox Text1
Alignment = 2 'Center
DataField = "检测日期"
Height = 375
Left = 1200
TabIndex = 2
Text = "Text1"
Top = 720
Width = 1215
End
Begin VB.Label Label8
Caption = "抑制率"
Height = 375
Left = 6480
TabIndex = 17
Top = 1440
Width = 735
End
Begin VB.Label Label7
Caption = "吸光度"
Height = 375
Left = 4920
TabIndex = 16
Top = 1440
Width = 735
End
Begin VB.Label Label6
Caption = "透光度"
Height = 375
Left = 3240
TabIndex = 15
Top = 1440
Width = 735
End
Begin VB.Label Label5
Caption = "类别"
Height = 375
Left = 1680
TabIndex = 14
Top = 1440
Width = 735
End
Begin VB.Label Label4
Caption = "产地"
Height = 375
Left = 6600
TabIndex = 13
Top = 360
Width = 735
End
Begin VB.Label Label3
Caption = "样品号"
Height = 375
Left = 4920
TabIndex = 12
Top = 360
Width = 735
End
Begin VB.Label Label2
Caption = "测试时间"
Height = 375
Left = 3120
TabIndex = 11
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "测试日期"
Height = 375
Left = 1440
TabIndex = 10
Top = 360
Width = 735
End
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Height = 2175
Left = -74520
TabIndex = 20
Top = 600
Width = 8775
_ExtentX = 15478
_ExtentY = 3836
_Version = 393216
Rows = 20
Cols = 9
FixedCols = 0
SelectionMode = 1
AllowUserResizing= 1
RowSizingMode = 1
_NumberOfBands = 1
_Band(0).Cols = 9
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2
Height = 3375
Left = 720
TabIndex = 55
Top = 2760
Width = 8535
_ExtentX = 15055
_ExtentY = 5953
_Version = 393216
Rows = 1000
Cols = 8
FixedCols = 0
SelectionMode = 1
AllowUserResizing= 3
RowSizingMode = 1
_NumberOfBands = 1
_Band(0).Cols = 8
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnn1 As ADODB.Connection
Dim Chang_Record As ADODB.Recordset
Dim strCnn As String
Dim varDate As Variant
Dim DataS() As Byte
Private Sub Command1_Click()
Chang_Record.Update
MSHFlexGrid1.Refresh
End Sub
Private Sub Command2_Click()
Chang_Record.Close
Unload Me
End Sub
Private Sub Command3_Click()
Dim Cx_Num As Integer
Dim Cx_Flag As Integer
Dim Cx_sTring As String
Cx_Num = 0
Cx_Flag = 0
Cx_sTring = ""
Chang_Record.Close
For i = 0 To 7
If Trim(Text9(i).Text) <> "" Then
If Not (IsDate(Text9(0).Text)) Then
MsgBox "非法日期输入,请重新按格式输入!", , "警告"
Exit Sub
End If
If Not (IsDate(Text9(1).Text)) Then
MsgBox "非法时间输入,请重新按格式输入!", , "警告"
Exit Sub
End If
If Val(Text9(5).Text) = 0 Then
MsgBox "非法输入,请重新输入透光度(0-1)!", , "警告"
Exit Sub
End If
If Val(Text9(6).Text) = 0 Then
MsgBox "非法输入,请重新输入吸光度(0-2)!", , "警告"
Exit Sub
End If
If Val(Text9(7).Text) = 0 Then
MsgBox "非法输入,请重新输入抑制率(0-100)!", , "警告"
Exit Sub
End If
Cx_Num = Cx_Num + 1
End If
Next i
For i = 0 To 7
If Trim(Text9(i).Text) <> "" Then
If Cx_Flag = 0 Then
Cx_sTring = " where "
Select Case i
Case 0
Cx_sTring = Cx_sTring & " " & "Jc_Date=" & """" & Trim(Text9(i).Text) & """"
Case 1
Cx_sTring = Cx_sTring & " " & "Jc_time=" & """" & Trim(Text9(i).Text) & """"
Case 2
Cx_sTring = Cx_sTring & " " & "Yp_Id=" & """" & Trim(Text9(i).Text) & """"
Case 3
Cx_sTring = Cx_sTring & " " & "Yp_dress=" & """" & Trim(Text9(i).Text) & """"
Case 4
Cx_sTring = Cx_sTring & " " & "Yp_cls=" & """" & Trim(Text9(i).Text) & """"
Case 5
Cx_sTring = Cx_sTring & " " & "Trans=" & """" & Trim(Text9(i).Text) & """"
Case 6
Cx_sTring = Cx_sTring & " " & "Absorb=" & """" & Trim(Text9(i).Text) & """"
Case 7
Cx_sTring = Cx_sTring & " " & "Contrl=" & """" & Trim(Text9(i).Text) & """"
End Select
Else
Select Case i
Case 0
Cx_sTring = Cx_sTring & " and " & "Jc_Date=" & """" & Trim(Text9(i).Text) & """"
Case 1
Cx_sTring = Cx_sTring & " and " & "Jc_time=" & """" & Trim(Text9(i).Text) & """"
Case 2
Cx_sTring = Cx_sTring & " and " & "Yp_Id=" & """" & Trim(Text9(i).Text) & """"
Case 3
Cx_sTring = Cx_sTring & " and " & "Yp_dress=" & """" & Trim(Text9(i).Text) & """"
Case 4
Cx_sTring = Cx_sTring & " and " & "Yp_cls=" & """" & Trim(Text9(i).Text) & """"
Case 5
Cx_sTring = Cx_sTring & " and " & "Trans=" & """" & Trim(Text9(i).Text) & """"
Case 6
Cx_sTring = Cx_sTring & " and " & "Absorb=" & """" & Trim(Text9(i).Text) & """"
Case 7
Cx_sTring = Cx_sTring & " and " & "Contrl=" & """" & Trim(Text9(i).Text) & """"
End Select
End If
Cx_Flag = 1
End If
Next i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -