📄 frmrivercx.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmRiverCx
Caption = " 河口水数据查询 "
ClientHeight = 7605
ClientLeft = 60
ClientTop = 450
ClientWidth = 11280
LinkTopic = "Form1"
ScaleHeight = 7605
ScaleWidth = 11280
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
BackColor = &H0080FFFF&
Caption = "点击这里进入统计图"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4320
Style = 1 'Graphical
TabIndex = 11
Top = 5880
Width = 2895
End
Begin VB.PictureBox Pic1
Height = 495
Left = 5520
ScaleHeight = 435
ScaleWidth = 675
TabIndex = 10
Top = 6840
Width = 735
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3615
Left = 120
TabIndex = 9
Top = 360
Width = 10815
_ExtentX = 19076
_ExtentY = 6376
_Version = 393216
Appearance = 0
BackColor = 15200239
DefColWidth = 74
HeadLines = 1
RowHeight = 15
AllowDelete = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "显 示 栏 "
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar StatusBar3
Align = 2 'Align Bottom
Height = 15
Left = 0
TabIndex = 8
Top = 7590
Width = 11280
_ExtentX = 19897
_ExtentY = 26
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Frame Frame1
BackColor = &H00E7EFEF&
Caption = "查询选项"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1935
Left = 360
TabIndex = 4
Top = 4200
Width = 2295
Begin VB.OptionButton Option3
BackColor = &H00E7EFEF&
Caption = "按采样地点"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 240
TabIndex = 6
Top = 960
Width = 1815
End
Begin VB.OptionButton Option2
BackColor = &H00E7EFEF&
Caption = "按采样日期"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 465
Left = 240
TabIndex = 5
Top = 360
Width = 1815
End
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 5160
TabIndex = 3
Top = 5040
Width = 2175
End
Begin VB.CommandButton Command4
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 9000
Picture = "FrmRiverCx.frx":0000
Style = 1 'Graphical
TabIndex = 2
Top = 4920
Width = 1455
End
Begin VB.CommandButton Command2
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 9000
Picture = "FrmRiverCx.frx":10BE
Style = 1 'Graphical
TabIndex = 1
Top = 5880
Width = 1455
End
Begin VB.CommandButton Command1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 9000
Picture = "FrmRiverCx.frx":217B
Style = 1 'Graphical
TabIndex = 0
Top = 4080
Width = 1455
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "在下面输入查询内容:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3240
TabIndex = 7
Top = 4560
Width = 2895
End
End
Attribute VB_Name = "FrmRiverCx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim WithEvents rs As Recordset
Attribute rs.VB_VarHelpID = -1
Dim i As Integer
Dim j As Integer
Private Sub BackG(f As Form, pic As PictureBox)
For i = 0 To (f.ScaleWidth \ pic.Width)
For j = 0 To (f.ScaleHeight \ pic.Height)
PaintPicture pic.Picture, i * pic.Width, j * pic.Height
Next
Next
End Sub
Private Sub Command3_Click()
FrmRiverTj.Show
End Sub
Private Sub Form_Load()
Me.AutoRedraw = True
Pic1.Visible = False
Pic1.BorderStyle = 0
Pic1.AutoSize = True
Pic1.Picture = LoadPicture(App.Path + "\02.gif")
BackG Me, Pic1
End Sub
Private Sub Form_resize()
BackG Me, Pic1
End Sub
Private Sub Command1_Click()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db1.mdb;" & "Persist Security Info=False;"
Dim rs As Recordset
Set rs = New Recordset
rs.Open "select * from 河口水评价结果表", db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rs
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Dim db As Connection
Set db = New Connection
Dim rs As Recordset
db.CursorLocation = adUseClient
'连接到数据源
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db1.mdb;" & "Persist Security Info=False;"
If Text1 = "" Or (Option2.Value = False And Option3.Value = False) Then
MsgBox "你没有选择查询选项或是没有输入查询条件!"
Exit Sub
End If
If Option2.Value = True Then
'按采取时间查询
Text1.SetFocus
Set rs = New Recordset
rs.Open "select * from 河口水评价结果表 where 采样日期 ='" & Trim(Text1) & "'", db, adOpenStatic, adLockOptimistic
If (rs.EOF And rs.BOF) Then
MsgBox "采样日期不存在,日期格式例如2001-2-2", vbCritical, "提示"
Text1 = ""
Exit Sub
ElseIf Not (rs.BOF And rs.EOF) Then
Set DataGrid1.DataSource = rs
End If
ElseIf Option3.Value = True Then '按采取地点查询
Text1.SetFocus
Set rs = New Recordset
rs.Open "select * from 河口水评价结果表 where 采样地点='" & Trim(Text1) & "'", db, adOpenStatic, adLockOptimistic
If (rs.EOF And rs.BOF) Then
MsgBox "采样地点不存在", vbCritical, "提示"
Text1 = ""
Exit Sub
ElseIf Not (rs.BOF And rs.EOF) Then
Set DataGrid1.DataSource = rs
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -