Dim oCon As New ADODB.Connection
Dim oRS As New ADODB.Recordset
oCon.Open "Provider=Microsoft.ACE.OLEDB.12.0;" _
& "Data Source=" & CurrentProject.Path & "\Order_DataBase.accdb;"
Me.ComboBox1.AddItem oRS.Fields
oRS.Close
oCon.Close
Set oRS = Nothing
Set oCon = Nothing总是提示2047错误.
请教大侠们.
Dim oRS As New ADODB.Recordset
oCon.Open "Provider=Microsoft.ACE.OLEDB.12.0;" _
& "Data Source=" & CurrentProject.Path & "\Order_DataBase.accdb;"
Me.ComboBox1.AddItem oRS.Fields
oRS.Close
oCon.Close
Set oRS = Nothing
Set oCon = Nothing总是提示2047错误.
请教大侠们.
Dim oRS As New ADODB.Recordset
dim i As integer
oCon.Open "Provider=Microsoft.ACE.OLEDB.12.0;" _
& "Data Source=" & CurrentProject.Path & "\Order_DataBase.accdb;"
if oRS.state<>adstateclosed then oRS.close
oRS.open " select aa from 表名 "
ComboBox1.clear
for i=1 to oRS.recordcount
ComboBox1.AddItem oRS!aa &""
oRS.movenext
next i
oRS.Close
oCon.Close
Set oRS = Nothing
Set oCon = Nothing