首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

如何让text1显示所有的数据,而不是只有最后一条记录

2012-03-15 
怎么让text1显示所有的数据,而不是只有最后一条记录Form_Load()里我写了SetcnnNewADODB.ConnectionIfcnn.

怎么让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

热点排行
Bad Request.