📄 frm_qgyb.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 Frm_Qgyb
Caption = "全国邮政编码"
ClientHeight = 3825
ClientLeft = 60
ClientTop = 345
ClientWidth = 6330
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3825
ScaleWidth = 6330
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 255
Top = 2295
Visible = 0 'False
Width = 1410
_ExtentX = 2487
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_Client"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_Client"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tb_Client_csxx"
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 VB.Frame Frame1
Height = 630
Left = 15
TabIndex = 1
Top = 3135
Width = 6210
Begin VB.TextBox Txt_Xs
Height = 350
Left = 2835
TabIndex = 7
Top = 195
Width = 1050
End
Begin VB.CommandButton Cmd_Exit
Caption = "退出"
Height = 350
Left = 5040
TabIndex = 5
Top = 195
Width = 950
End
Begin VB.CommandButton Cmd_Dy
Caption = "打印"
Height = 350
Left = 4005
TabIndex = 4
Top = 195
Width = 950
End
Begin VB.TextBox Txt_Sf
Height = 350
Left = 900
TabIndex = 3
Top = 195
Width = 1050
End
Begin VB.Label Label2
Caption = "县市名称"
Height = 195
Left = 2010
TabIndex = 6
Top = 270
Width = 765
End
Begin VB.Label Label1
Caption = "省份名称"
Height = 195
Left = 120
TabIndex = 2
Top = 270
Width = 780
End
End
Begin MSDataGridLib.DataGrid Dgr_Yb
Bindings = "Frm_Qgyb.frx":0000
Height = 3110
Left = 15
TabIndex = 0
Top = 30
Width = 6195
_ExtentX = 10927
_ExtentY = 5477
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
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 = 5
BeginProperty Column00
DataField = "csxx_csjc"
Caption = "csxx_csjc"
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 = "csxx_sfmc"
Caption = "csxx_sfmc"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "csxx_csmc"
Caption = "csxx_csmc"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "csxx_yb"
Caption = "csxx_yb"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "csxx_dhqh"
Caption = "csxx_dhqh"
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
ColumnWidth = 1005.165
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
BeginProperty Column03
ColumnWidth = 1365.165
EndProperty
BeginProperty Column04
ColumnWidth = 1365.165
EndProperty
EndProperty
End
End
Attribute VB_Name = "Frm_Qgyb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Sub Dgr_Title() '设置DataGrid控件的标题信息
Dgr_Yb.Columns(0).Caption = "省份简称"
Dgr_Yb.Columns(1).Caption = "省份名称"
Dgr_Yb.Columns(2).Caption = "城市名称"
Dgr_Yb.Columns(3).Caption = "邮政编码"
Dgr_Yb.Columns(4).Caption = "电话区号"
End Sub
Sub Dgr_Width() '设置DataGrid控件的宽度
Dgr_Yb.Columns(0).Width = 850
Dgr_Yb.Columns(1).Width = 1500
Dgr_Yb.Columns(2).Width = 1500
Dgr_Yb.Columns(3).Width = 900
Dgr_Yb.Columns(4).Width = 850
End Sub
Private Sub Cmd_Dy_Click() '打印
If Txt_Sf.Text = "" Then
DataE1.rsCommand3.Open "select * from tb_Client_csxx where csxx_csmc like +'%'+'" + Txt_Xs + "'+'%' "
If DataE1.rsCommand3.RecordCount > 0 Then
Unload Me
Dr_Qgyb.Show
End If
Else
DataE1.rsCommand3.Open "select * from tb_Client_csxx where csxx_sfmc like + '%'+'" + Txt_Sf + "'+'%' and csxx_csmc like +'%'+'" + Txt_Xs + "'+'%'"
If DataE1.rsCommand3.RecordCount > 0 Then
Unload Me
Dr_Qgyb.Show
End If
End If
End Sub
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
Private Sub Dgr_Yb_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Adodc1.Recordset.RecordCount > 0 Then
Frm_Khxxwh_kh.Cbx_Cs.Text = Adodc1.Recordset.Fields("csxx_csmc")
Frm_Khxxwh_kh.Txt1(3).Text = Adodc1.Recordset.Fields("csxx_yb")
Frm_Khxxwh_kh.Txt1(10).Text = Adodc1.Recordset.Fields("csxx_dhqh") + "-"
End If
Unload Me
Frm_Khxxwh_kh.Txt1(4).SetFocus
End If
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = PublicStr
Select Case Myflag
Case True
Cmd_Dy.Enabled = False
Case False
Cmd_Dy.Enabled = True
End Select
If Province <> "" Then
Txt_Sf.Text = Province
Set Dgr_Yb.DataSource = Adodc1
Call Dgr_Title
Call Dgr_Width
Else
Call Dgr_Title
Call Dgr_Width
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Province = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
Frm_Main.Enabled = True
End Sub
Private Sub Txt_Sf_Change() '按省份查询
Adodc1.RecordSource = "select * from tb_Client_csxx where csxx_sfmc like +'%'+'" + Txt_Sf + "'+'%'"
Adodc1.Refresh
Set Dgr_Yb.DataSource = Adodc1
Call Dgr_Title
Call Dgr_Width
End Sub
Private Sub Txt_Sf_GotFocus()
Txt_Sf.BackColor = &HFFFF80
End Sub
Private Sub Txt_Sf_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Txt_Xs.SetFocus
End Sub
Private Sub Txt_Sf_LostFocus()
Txt_Sf.BackColor = &HFFFFFF
End Sub
Private Sub Txt_Xs_Change() '按城市查询
If Txt_Sf.Text = "" Then
Adodc1.RecordSource = "select * from tb_Client_csxx where csxx_csmc like +'%'+'" + Txt_Xs + "'+'%' "
Adodc1.Refresh
Set Dgr_Yb.DataSource = Adodc1
Call Dgr_Title
Call Dgr_Width
Else
Adodc1.RecordSource = "select * from tb_Client_csxx where csxx_sfmc like + '%'+'" + Txt_Sf + "'+'%' and csxx_csmc like +'%'+'" + Txt_Xs + "'+'%'"
Adodc1.Refresh
Set Dgr_Yb.DataSource = Adodc1
Call Dgr_Title
Call Dgr_Width
End If
End Sub
Private Sub Txt_Xs_GotFocus()
Txt_Xs.BackColor = &HFFFFF8
End Sub
Private Sub Txt_Xs_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Cmd_Dy.SetFocus
End Sub
Private Sub Txt_Xs_LostFocus()
Txt_Xs.BackColor = &HFFFFFF
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -