有一存储过程如下
declare @sql varchar(8000) 
set @sql='select e_zxsb.xh+e_zxsb.xm as  姓名,'
select @sql=@sql+'max(case kcdm when '''+rtrim(kcdm)+''' then zpcj else 0 end) as '''+rtrim(kcdm+kcmc) +''',' 
from (select distinct kcdm,kcmc 
from (select kcdm+'-1'as kcdm,kcmc from r_jxjh where f1>'0' and zydm='20022010104'
union select kcdm+'-2'as kcdm,kcmc from r_jxjh where f2>'0' and zydm='20022010104'
union select kcdm+'-3'as kcdm,kcmc from r_jxjh where f3>'0' and zydm='20022010104'
union select kcdm+'-4'as kcdm,kcmc from r_jxjh where f4>'0' and zydm='20022010104'
union select kcdm+'-5'as kcdm,kcmc from r_jxjh where f5>'0' and zydm='20022010104'
union select kcdm+'-6'as kcdm,kcmc from r_jxjh where f6>'0' and zydm='20022010104'
union select kcdm+'-7'as kcdm,kcmc from r_jxjh where f7>'0' and zydm='20022010104'
union select kcdm+'-8'as kcdm,kcmc from r_jxjh where f8>'0' and zydm='20022010104') as b) as a 
select @sql=left(@sql,len(@sql)-1)+' from e_zxsb,r_cjb where e_zxsb.xh=r_cjb.xh group by e_zxsb.xh+e_zxsb.xm'
exec (@sql)存储过程在查询分析器中运行正常,可以返回数据,但用VB中的ADO数据集却无法返回数据,返回的数据行数为-1,用MSHFLEXGRID绑定数据集能正常显示,请教高手怎么可以用数据集而不用绑定的方法可取得数据!!~在此先谢了!~