# 为什么我的List1中无任何选项

Posted by jeff on May 08, 1999 at 09:33:28:

我的Source Code 如下:

Private Sub Form_Load()
Dim i As Integer
Dim k As Boolean
Dim s As String
Set dbs = OpenDatabase("c:\s\vbdb.mdb")
Set trade = dbs.OpenRecordset("select 班级资料.班级名称 from 班级资料")
trade.MoveLast
trade.MoveFirst
's = "0"
For i = 0 To trade.RecordCount - 1
'Do Until trade.EOF
If trade("班级名称") <> 0 Then
List1.AddItem trade(0)
trade.MoveNext
End If
' Loop
Next
trade.Close
'List1.ListIndex = -1
'List2.ListIndex = -1
' List1.ListIndex = -1
End Sub

我检查过我的资料库中有8笔资料
但是我的List1中确无任何资料
应该是下列程式的问题
可以这样写Program吗?

If trade("班级名称") <> 0 Then
List1.AddItem trade(0)
trade.MoveNext
很疑惑

Follow Ups:

- Re: 为什么我的List1中无任何选项 小呆 14:41:18 5/08/99 (0)