📄 frm_bmcx.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
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 frm_bmcx
BorderStyle = 1 'Fixed Single
Caption = "编码查询"
ClientHeight = 5490
ClientLeft = 45
ClientTop = 330
ClientWidth = 9285
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 5490
ScaleWidth = 9285
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text2
Height = 315
Left = 3825
TabIndex = 6
Top = 5115
Width = 1365
End
Begin VB.TextBox Text1
Height = 315
Left = 1305
TabIndex = 3
Top = 5115
Width = 1125
End
Begin MSComctlLib.ImageList ImageList1
Left = 5955
Top = 5670
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_bmcx.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm_bmcx.frx":165A
Key = ""
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 360
Left = 3195
Top = 5685
Width = 2700
_ExtentX = 4763
_ExtentY = 635
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 = -2147483643
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 = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frm_bmcx.frx":2CB4
Height = 5010
Left = 2505
TabIndex = 1
Top = 45
Width = 6735
_ExtentX = 11880
_ExtentY = 8837
_Version = 393216
AllowUpdate = 0 'False
BackColor = -2147483624
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
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
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
MarqueeStyle = 3
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 5025
Left = 60
TabIndex = 0
Top = 30
Width = 2370
_ExtentX = 4180
_ExtentY = 8864
_Version = 393217
LabelEdit = 1
Style = 7
FullRowSelect = -1 'True
HotTracking = -1 'True
SingleSel = -1 'True
ImageList = "ImageList1"
Appearance = 1
End
Begin VB.Label Label3
Caption = "输入城市查询"
Height = 255
Left = 2550
TabIndex = 5
Top = 5220
Width = 1245
End
Begin VB.Label Label2
Height = 255
Left = 6600
TabIndex = 4
Top = 5190
Width = 2580
End
Begin VB.Label Label1
Caption = "输入省份查询"
Height = 240
Left = 75
TabIndex = 2
Top = 5205
Width = 1140
End
End
Attribute VB_Name = "frm_bmcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Tree_change()
Dim Key, Text, BH As String
Dim Nod As Node
Key = "所有编码"
Text = "所有编码"
Set Node1 = TreeView1.Nodes.Add(, , Key, Text, 1)
AdoRs.Open "select distinct 省份 from 邮编大全 ", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
AdoRs.MoveFirst
Do While AdoRs.EOF = False
Key = Trim(AdoRs.Fields("省份"))
Text = AdoRs.Fields("省份")
Set Node2 = TreeView1.Nodes.Add(Node1.Index, tvwChild, Key, Text, 2)
AdoRs.MoveNext
Loop
End If
AdoRs.Close
End Sub
Private Sub Form_Load()
Call Tree_change
Adodc1.ConnectionString = PublicStr
Adodc1.RecordSource = "select * from 邮编大全"
Adodc1.Refresh
Label2.Caption = "总计查询记录的条数为 " & Adodc1.Recordset.RecordCount
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Adodc1.ConnectionString = PublicStr
Adodc1.RecordSource = "select * from 邮编大全 where 省份='" + Text1.Text + "'"
Adodc1.Refresh
Label2.Caption = "总计查询记录的条数为 " & Adodc1.Recordset.RecordCount
End If
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Adodc1.ConnectionString = PublicStr
Adodc1.RecordSource = "select * from 邮编大全 where 省份='" + TreeView1.SelectedItem + "'"
Adodc1.Refresh
Label2.Caption = "总计查询记录的条数为 " & Adodc1.Recordset.RecordCount
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Adodc1.ConnectionString = PublicStr
Adodc1.RecordSource = "select * from 邮编大全 where 城市 Like '%" + Text2.Text + "%'"
Adodc1.Refresh
Label2.Caption = "总计查询记录的条数为 " & Adodc1.Recordset.RecordCount
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -