Public con As Connection
Public rst As Recordset
Public Sub Connect()
Set con = New Connection
Set rst = New Recordset
With con
.Provider = "sqloledb"
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=数据库名;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
.Open
End With
End Sub
Private Sub Form_Load()
rst.open "select * from 表名 ",con,1,3
while not rst.eof
Combo1.AddItem rst(0)
rst.movenext
wend
End Sub