这样不行吗?
sql="select * from 表"
……
do while (not rs.eof)
 str=str+"   "+rs.fields("id")+" "+rs.fields("name")+" "+rs.fields("sex")
rs.movenext
loop

解决方案 »

  1.   

    看好:
    rs.open"select * from table"for i=1 to rs.recordcount
        for j=1 to rs.fields.count
            str= str & rs.fields(j-1).value
        next
        rs.movenext
    nextok,祝好运!
      

  2.   

    select t1.*, t2.*, t3.* from
     (select * from tempTable where id=1) t1,
     (select * from tempTable where id=2) t2,
     (select * from tempTable where id=3) t3
      

  3.   

    更通用的写法,当然前提是字段id的值是以1为间隔依次递增的:
    select t1.*, t2.*, t3.* from 
     (select * from tempTable where id%3=1) t1 inner join    
     (select * from tempTable where id%3=2) t2 
       on t1.id + 1 = t2.id inner join
     (select * from tempTable where id%3=0) t3
       on t1.id + 2 = t3.id
      

  4.   

    其实我的意思是:
       把记录不用竖的方式显示,而用横的,也就是说用横的方式,一条接一条,其环境是在SQL中,当然上面  hycao(海草) 兄的应该可以吧,不过,我的机器还没有装SQL!但是有一点是子SELECT 的WHERE 该怎获得每条记录的关键字呢??如果ID 不是递增的或是字符的呢???
    ‘**********************************************
    更通用的写法,当然前提是字段id的值是以1为间隔依次递增的:
    select t1.*, t2.*, t3.* from 
     (select * from tempTable where id%3=1) t1 inner join    
     (select * from tempTable where id%3=2) t2 
       on t1.id + 1 = t2.id inner join
     (select * from tempTable where id%3=0) t3
       on t1.id + 2 = t3.id
    ’**********************************************