关于数据绑定出现的错误!!!请斑竹或各位大虾帮我分析一下!(115分)

Z

zdy928

Unregistered / Unconfirmed
GUEST, unregistred user!
var
ftt:CmapXFeature;
ft: MapXLib_TLB.FindFeature;//查找的图元
lyr: MapXLib_TLB.Layer;
//图层
bExist: Boolean;
i: Integer;
str: String;
X,Y:double;
mkk,mk:cmapxAnnotation;
Bitmaps: BitmapSymbols;
StyleBitmap: Style;
fNewSymbol: Variant;
fMapSymbol: Feature;
ss:string;
oBLayer : MapXLib_TLB.BindLayer;

begin

oBLayer := coBindLayer.Create;
oBLayer.LayerName := 'AGS';

oBLayer.LayerType := miBindLayerTypeXY;//必须使用这个参数才能绑定XY坐标
oBLayer.RefColumn1 := 'XX';//第一个参数必须指定为横坐标
oBLayer.RefColumn2 := 'YY';//纵坐标 }
//添加数据集

adosee.close;
adosee.Open;
ds := map1.Datasets.Add(miDataSetADO,//数据集类型,这是miDataSetADO,即ADO专用的
adosee.Recordset,//使用这个方法获得ADO中的_Recordset类型
'Water',//数据集名称
'STCD',//传入的是Xunit表中的字段ID的名称
EmptyParam,
oBLayer,//BindLayer
EmptyParam,
EmptyParam);

//下边将设置新图层的各项属性
searchLayer := map1.Layers.Item['AGS'];
//字体颜色
searchLayer.LabelProperties.Style.TextFontColor := miColorPurple;
searchLayer.LabelProperties.Style.TextFontHalo := true;
searchLayer.LabelProperties.Style.TextFontBackColor := miColorWhite;
//设置图元显示的标签
searchLayer.LabelProperties.Dataset := ds;
ds.AddField('CurZ','STNM+chr$(13)+Z');
searchLayer.LabelProperties.DataField := ds.Fields.Item['CurZ'];
// searchLayer.LabelProperties.LabelZoom := true;
//设置图层缩放比例范围
//自动标记图元
searchLayer.AutoLabel := true;
adosee.close;
end;

在运行到ds := map1.Datasets.Add(miDataSetADO这行会出现一个错误:
custom dataset error.could not fina a clsid for the type of custom dataset specified.
 
顶部