Private Sub Command1_Click()
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
S = ""
For i = 0 To Adodc1.Recordset.Fields.Count - 1
S = S & Adodc1.Recordset.Fields(i).Value & Chr(vbKeyTab)
Next
List1.AddItem S
Adodc1.Recordset.MoveNext
Wend
End Sub
執行後會顯示每一筆資料的每一項
但在S = S &.............中
若我將 S & 拿掉的話他會在ListBox中顯示每一筆資料的最後一項
S = "" 有何作用呢???
為甚麼會造成這樣的結果呢???