VB 为什么list1 list2不会加载任何项呢?
PrivateSubSystemLibrary_Load()Data2.Recordset.MoveFirstDoWhileNotData2.Recordset.EOFL...
Private Sub SystemLibrary_Load()
Data2.Recordset.MoveFirst
Do While Not Data2.Recordset.EOF
List1.AddItem Data2.Recordset.Fields(1)
Data2.Recordset.MoveNext
Loop
Data3.Recordset.MoveFirst
Do While Not Data3.Recordset.EOF
List2.AddItem Data3.Recordset.Fields(1)
Data3.Recordset.MoveNext
Loop
End Sub
我的data里有数据啊 展开
Data2.Recordset.MoveFirst
Do While Not Data2.Recordset.EOF
List1.AddItem Data2.Recordset.Fields(1)
Data2.Recordset.MoveNext
Loop
Data3.Recordset.MoveFirst
Do While Not Data3.Recordset.EOF
List2.AddItem Data3.Recordset.Fields(1)
Data3.Recordset.MoveNext
Loop
End Sub
我的data里有数据啊 展开
展开全部
Private Sub SystemLibrary_Load()
Data2.Recordset.MoveFirst
MsgBox "有" & Data2.Recordset.RecordCount & "个记录"
Do While Not Data2.Recordset.EOF
List1.AddItem Data2.Recordset.Fields(1)
Data2.Recordset.MoveNext
Loop
MsgBox "有" & Data3.Recordset.RecordCount & "个记录"
Data3.Recordset.MoveFirst
Do While Not Data3.Recordset.EOF
List2.AddItem Data3.Recordset.Fields(1)
Data3.Recordset.MoveNext
Loop
End Sub
-------------------------------
运行我的代码,看看你的data里到底有没有数据
-------------------------------
因为你的Data2.Recordset里是空的,没有记录,自然就不会添加,建议你检查一下你的查询语句
--------------------------------
Data2.Recordset.MoveFirst
MsgBox "有" & Data2.Recordset.RecordCount & "个记录"
Do While Not Data2.Recordset.EOF
List1.AddItem Data2.Recordset.Fields(1)
Data2.Recordset.MoveNext
Loop
MsgBox "有" & Data3.Recordset.RecordCount & "个记录"
Data3.Recordset.MoveFirst
Do While Not Data3.Recordset.EOF
List2.AddItem Data3.Recordset.Fields(1)
Data3.Recordset.MoveNext
Loop
End Sub
-------------------------------
运行我的代码,看看你的data里到底有没有数据
-------------------------------
因为你的Data2.Recordset里是空的,没有记录,自然就不会添加,建议你检查一下你的查询语句
--------------------------------
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询