📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3480
ClientLeft = 60
ClientTop = 345
ClientWidth = 2700
LinkTopic = "Form1"
ScaleHeight = 3480
ScaleWidth = 2700
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox cob
Height = 300
Left = 240
TabIndex = 0
Text = "Combo1"
Top = 360
Width = 2055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mrc As ADODB.Recordset
Dim cnn As String
Dim I As Long, J As Long
Dim RcN, RcA As Long
Private Sub cob_Click()
cob = Trim(Mid(cob.Text, 6, 50))
End Sub
Private Sub Form_Load()
cnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db.mdb;Persist Security Info=False"
Set mrc = New ADODB.Recordset
With mrc
.ActiveConnection = cnn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
.Source = "select * from table1"
.Open
End With
cob.Clear
For I = 0 To mrc.RecordCount - 1
cob.AddItem Trim(Format(mrc.Fields(0), "0000") & "|" & mrc.Fields(1))
mrc.MoveNext
Next I
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -