添加数据集出错(100分)

  • 主题发起人 主题发起人 wenzhi
  • 开始时间 开始时间
W

wenzhi

Unregistered / Unconfirmed
GUEST, unregistred user!
var
i,count:integer;
mbindLayer : BindLayer;


mbindLayer.LayerName := LayerName;
mbindLayer.LayerType := miBindLayerTypeXY;
//必须使用这个参数才能绑定XY坐标
mbindLayer.RefColumn1 := RefColumn1;//第一个参数必须指定为横坐标x_value
mbindLayer.RefColumn2 := RefColumn2;//纵坐标 y_value}
//添加数据集
FDataset := MapInfo.Datasets.Add(miDataSetADO,//数据集类型,这是miDataSetADO,即ADO专用的
FAdoQuery.Recordset,//使用这个方法获得ADO中的_Recordset类型
DataSetName,//数据集名称
GeoField,//传入的是qryExec表中的字段ID的名称
EmptyParam, mbindLayer,//BindLayer
EmptyParam, EmptyParam);



A类 strSQL := ' select to_number(e.code) as id,max(e.name) as name,' +

' max(e.x_value) as X_VALUE,max(e.y_value) as Y_VALUE, ' +
' sum(m.a) as AA,sum(m.b) as BB,sum(m.c) as CC' +
' from ' +
' ( select count(*) as A,0 as B, 0 as C ,1 as area from cust ' +
' where CLASSIFY=''A'' group by CLASSIFY ' +
' union '+
' select 0 as A,count(*) as B,0 as C,1 as area from cust ' +
' where CLASSIFY=''B'' group by CLASSIFY ' +
' union ' +
' select 0 as A,0 as B,count(*) as C,1 as area from cust ' +
' where CLASSIFY=''C'' group by CLASSIFY '+
' ) m,earea e ' +
' where m.area=e.CODE group by e.code '

B类 strsql := 'select id,name,x_value,y_value,amount,second,first from gis_cust'

为什么使用不同的SQL语句时会出错,
当我使用A类语句时,只要把BindLayer对象设为空EmptyParam
就不报错,而使用B类语句时直接使用indLayer对象就不报错
 
怎么没人答呢
 
版主帮忙看下吧
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
1K
import
I
后退
顶部