📄 frm_xqinfosc.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frm_xqinfosc
Caption = "小区信息生成"
ClientHeight = 2445
ClientLeft = 3135
ClientTop = 2550
ClientWidth = 4665
Icon = "frm_xqinfosc.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2445
ScaleWidth = 4665
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 450
Top = 2760
Width = 2205
_ExtentX = 3889
_ExtentY = 582
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 VB.Frame Frame1
Caption = "选择生成区域数量"
Height = 2280
Left = 210
TabIndex = 0
Top = 120
Width = 4200
Begin VB.Frame Frame3
Height = 720
Left = 225
TabIndex = 8
Top = 1380
Width = 3750
Begin VB.CommandButton Command2
Caption = "返回主系统"
Height = 375
Left = 2055
TabIndex = 10
Top = 225
Width = 1100
End
Begin VB.CommandButton Command1
Caption = "开始生成"
Height = 375
Left = 330
TabIndex = 9
Top = 225
Width = 1100
End
End
Begin VB.Frame Frame2
Height = 960
Left = 225
TabIndex = 1
Top = 270
Width = 3750
Begin MSComCtl2.UpDown UpDown2
Height = 300
Left = 3151
TabIndex = 2
Top = 375
Width = 240
_ExtentX = 423
_ExtentY = 529
_Version = 393216
Value = 1
BuddyControl = "Text2"
BuddyDispid = 196615
OrigLeft = 3375
OrigTop = 360
OrigRight = 3615
OrigBottom = 660
Max = 1000
Min = 1
SyncBuddy = -1 'True
BuddyProperty = 65547
Enabled = -1 'True
End
Begin MSComCtl2.UpDown UpDown1
Height = 300
Left = 1920
TabIndex = 4
Top = 375
Width = 240
_ExtentX = 423
_ExtentY = 529
_Version = 393216
Value = 1
BuddyControl = "Text1"
BuddyDispid = 196614
OrigLeft = 1905
OrigTop = 360
OrigRight = 2145
OrigBottom = 660
Max = 1000
Min = 1
SyncBuddy = -1 'True
BuddyProperty = 65547
Enabled = -1 'True
End
Begin VB.TextBox Text1
Height = 300
Left = 975
TabIndex = 5
Top = 375
Width = 945
End
Begin VB.TextBox Text2
Height = 300
Left = 2445
TabIndex = 3
Top = 375
Width = 705
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "小区编号:"
Height = 180
Left = 75
TabIndex = 7
Top = 435
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "至"
Height = 180
Left = 2220
TabIndex = 6
Top = 420
Width = 180
End
End
End
Begin VB.Label Label3
Caption = "Label3"
Height = 480
Left = 900
TabIndex = 11
Top = 3915
Width = 1605
End
End
Attribute VB_Name = "frm_xqinfosc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer '定义整型变量
Private Sub Command1_Click() '开始生成
If Adodc1.Recordset.RecordCount = 0 Then
For i = Val(Text1.Text) To Val(Text2.Text)
adors.Open "select * from tab_xqinfo where 小区编号='" + Trim(Str(i)) + "'", cn, adOpenKeyset, adLockOptimistic
'Val 函数返回包含于字符串内的数字,字符串中是一个适当类型的数值。
'Trim 函数返回 Variant (String),其中包含指定字符串的拷贝,没有前导空白 (LTrim)、尾随空白 (RTrim) 或前导和尾随空白 (Trim)。
'Str 函数返回代表一数值的 Variant (String)。
Set adors = cn.Execute("insert into tab_xqinfo (小区编号) values('" & Trim(Str(i)) & "')")
Next i
MsgBox "操作已成功!", , "系统提示"
Unload Me
Else
MsgBox "小区信息已生成!", , "系统提示"
End If
' With adors
' If .RecordCount = 0 Then
' Set adors = cn.Execute("insert into tab_xqinfo (小区编号) values('" & Trim(Str(i)) & "')")
' MsgBox "操作已成功!", , "系统提示"
' Else
' MsgBox i & "小区已存在!", , "系统提示"
' adors.Close
' End If
' End With
End Sub
Private Sub Command2_Click() '返回主系统
Load Frm_main
Frm_main.Show
Unload Me
End Sub
Private Sub Form_Load()
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"
Adodc1.Refresh
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text2.SetFocus '按回车键Text2获得焦点
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Command1.SetFocus '按回车键Command1获得焦点
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -