📄 frmdzcx.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmDZCX
BackColor = &H00FF0000&
Caption = "到站查询"
ClientHeight = 6210
ClientLeft = 60
ClientTop = 345
ClientWidth = 11880
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6210
ScaleWidth = 11880
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 7200
Top = 5640
Width = 2775
_ExtentX = 4895
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = 65535
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
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
_Version = 393216
End
Begin VB.CommandButton Command4
Caption = "退 出"
Height = 375
Left = 11160
Picture = "frmDZCX.frx":0000
Style = 1 'Graphical
TabIndex = 12
Top = 5640
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "刷 新"
Height = 375
Left = 4680
Picture = "frmDZCX.frx":0B25
Style = 1 'Graphical
TabIndex = 11
Top = 5640
Width = 1335
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 5175
Left = 3600
TabIndex = 9
Top = 240
Width = 9375
_ExtentX = 16536
_ExtentY = 9128
_Version = 393216
BackColor = 65535
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
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
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 VB.Frame Frame7
Caption = "查询方式选择"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 6015
Left = 120
TabIndex = 0
Top = 120
Width = 3375
Begin VB.OptionButton Option5
Caption = " 按是否到货"
ForeColor = &H00C00000&
Height = 285
Left = 720
TabIndex = 10
Top = 2520
Width = 1815
End
Begin VB.OptionButton Option1
Caption = " 按到货时间"
ForeColor = &H00C00000&
Height = 255
Index = 1
Left = 720
TabIndex = 7
Top = 1920
Width = 1815
End
Begin VB.OptionButton Option2
Caption = " 按托运单号"
ForeColor = &H00C00000&
Height = 255
Left = 720
TabIndex = 6
Top = 1320
Width = 1815
End
Begin VB.OptionButton Option3
Caption = " 按到达状况"
ForeColor = &H00C00000&
Height = 360
Left = 720
TabIndex = 5
Top = 3120
Width = 1815
End
Begin VB.OptionButton Option4
Caption = " 按托运货品"
ForeColor = &H00C00000&
Height = 255
Left = 720
TabIndex = 4
Top = 720
Width = 1935
End
Begin VB.TextBox Text1
BackColor = &H0000FFFF&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 2
Left = 480
TabIndex = 3
Top = 4680
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "查 询"
Default = -1 'True
Height = 375
Index = 3
Left = 360
Picture = "frmDZCX.frx":164A
Style = 1 'Graphical
TabIndex = 2
Top = 5400
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "打 印"
Height = 375
Index = 1
Left = 1920
Picture = "frmDZCX.frx":216F
Style = 1 'Graphical
TabIndex = 1
Top = 5400
Width = 1095
End
Begin VB.Label Label1
Caption = "请输入要确认信息的关键字:"
ForeColor = &H00C00000&
Height = 255
Index = 0
Left = 360
TabIndex = 8
Top = 3960
Width = 2775
End
End
End
Attribute VB_Name = "frmDZCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Command1_Click(Index As Integer)
If Option4.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 货品名称 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 托运单号 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option1(1).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 收货时间 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option5.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 是否到货 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option3.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 货品信息 where 到达状态 like " & "'%" & Text1(2).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
End Sub
Private Sub Command3_Click()
rs.Close
rs.Open "select * from 货品信息", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
db.Open
rs.Open "select * from 货品信息", db, adOpenStatic, adLockReadOnly
Me.Hide
frmDZCX.Show
With Adodc1
.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
.RecordSource = "select * from 货品信息"
End With
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Me.Hide
MDIPSZX.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -