📄 frm_xqinfodj.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_xqinfodj
Caption = "现有小区列表"
ClientHeight = 3480
ClientLeft = 60
ClientTop = 345
ClientWidth = 5550
Icon = "Frm_xqinfodj.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3480
ScaleWidth = 5550
StartUpPosition = 2 '屏幕中心
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2265
Left = 120
TabIndex = 8
Top = 255
Width = 5295
_ExtentX = 9340
_ExtentY = 3995
_Version = 393216
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
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Frame Frame3
Caption = "操作"
Height = 765
Left = 2685
TabIndex = 4
Top = 2640
Width = 2790
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 1815
TabIndex = 7
Top = 240
Width = 885
End
Begin VB.CommandButton Command2
Caption = "加入"
Height = 375
Left = 945
TabIndex = 6
Top = 240
Width = 885
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 75
TabIndex = 5
Top = 240
Width = 885
End
End
Begin VB.Frame Frame2
Caption = "被选中小区"
Height = 765
Left = 45
TabIndex = 3
Top = 2640
Width = 2670
Begin VB.TextBox Text1
Height = 375
Left = 105
TabIndex = 9
Top = 255
Width = 2370
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 420
Left = 3015
Top = 4575
Width = 1935
_ExtentX = 3413
_ExtentY = 741
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 100
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 = ""
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 VB.Frame Frame1
Caption = "选择小区信息"
Height = 2565
Left = 45
TabIndex = 0
Top = 30
Width = 5445
End
Begin VB.Label Label2
Caption = "Label2"
DataField = "负责人"
DataSource = "Adodc1"
Height = 555
Left = 1380
TabIndex = 2
Top = 4500
Width = 1260
End
Begin VB.Label Label1
Caption = "Label1"
DataField = "小区名称"
DataSource = "Adodc1"
Height = 435
Left = 120
TabIndex = 1
Top = 4560
Width = 1185
End
End
Attribute VB_Name = "Frm_xqinfodj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "请选择小区名称", , "系统提示"
Exit Sub
End If
Frm_dl.Adodc1.RecordSource = "select * from tab_dlinfo where left(大楼编号,4) like '%" + Text1.Text + "%'"
'Left 函数返回 Variant (String),其中包含字符串中从左边算起指定数量的字符。
Frm_dl.Adodc1.Refresh
If Frm_dl.Adodc1.Recordset.RecordCount > 0 Then
Frm_dlinfo.Show
Unload Me
Me.Hide
Else
If MsgBox("你还没有生成大楼信息,现在生成大楼信息吗?", 4, "系统提示") = vbYes Then
Command4_Click
Load Frm_dlinfosc
Frm_dlinfosc.Show
End If
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Text1.Text = DataGrid1.Columns(1).Text
End Sub
Private Sub Command3_Click()
Debug.Print Adodc1.ConnectionString
End Sub
Private Sub Command4_Click()
Frm_xqinfodj.Hide
Frm_main.Show
End Sub
Private Sub Form_Load()
Sleep 1000
' Dim i As Integer '定义整型变量
'自动识别路径
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tab_xqinfo order by val(小区编号)"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -