回复 2楼 wxflw
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim connstr As String
Dim sql As String
connstr = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=PT_AS_DB;Data Source=ouyang-c19a8722."
conn.ConnectionString = connstr
conn.Open connstr
sql = "select * from WarehouseStockDetail "
rs.CursorLocation = adUseClient
rs.Open sql, conn, adOpenDynamic, adLockPessimistic
Do While Not rs.EOF And Not rs.BOF
Combo1.AddItem (rs.Fields(1))
List1.AddItem (rs.Fields(1))
rs.MoveNext
Loop
接下来就不知道怎么弄了