怎么让text1显示所有的数据,而不是只有最后一条记录
Form_Load()里我写了
Set cnn = New ADODB.Connection
If cnn.State = 1 Then
cnn.Close
End If
Dim SQLStr As String
cnn.Open = "Provider =SQLOLEDB;Initial Catalog=emg;Data Source=2号;UID=sa;Pwd=123456 "
Set rs = New ADODB.Recordset
Set cmd = New ADODB.Command
SQLStr = "select * from T_STOCK_TR "
Set rs = cnn.Execute(SQLStr)
While Not (rs.EOF Or rs.BOF)
Text1.Text = rs( "I_GAME_CD ")
rs.MoveNext
rs.Close
cnn.Close
怎么让text1显示所有的数据,而不是只有最后一条记录
[解决办法]
Text1.Text =Text1.Text & rs( "I_GAME_CD ")
[解决办法]
While Not (rs.EOF Or rs.BOF)
if Text1.Text <> ' ' then
Text1.Text = Text1.Text & 回车 & rs( "I_GAME_CD ")
else
Text1.Text = rs( "I_GAME_CD ")
end if
rs.MoveNext