J
jiordano
Unregistered / Unconfirmed
GUEST, unregistred user!
代码编译报错:unable to match goefield or bindlayer automatically
程序如下:
procedure TForm1.Button2Click(Sender: TObject);
var
par:variant;
ds:cmapxdataset;
bindlayerobject:bindlayer;
begin
par:=createoleobject('mapx.odbcqueryinfo.4');
par.SqlQuery := 'select test.longitude,test.latitude from test;';
par.DataSource := 'test';
par.ConnectString := 'Provider=MSDASQL.1User ID=jiordano;Data Source=test;DSN=test;DBQ=C:/DOCUMENTS AND SETTINGS/IAMCY/桌面/POJECT/test;DriverId=25;FIL=MS Access;Initial Catalog=C:/DOCUMENTS AND SETTINGS/IAMCY/桌面/POJECT/test';
BindLayerObject:= CoBindLayer.Create;
BindLayerObject.LayerName := 'mytab';
BindLayerObject.FileSpec := 'e:/incoming/project/map/map/mytab.tab';
BindLayerObject.refcolumn1:='longitude';
//excel中的坐标
BindLayerObject.RefColumn2 :='latitude';
//
BindLayerObject.LayerType := miBindLayerTypeXY;
ds:=Map1.Datasets.Add(miDatasetODBC, par, 'mytab', 'longitude', 'latitude', BindLayerObject, EmptyParam,false);
请问错在何处?
程序如下:
procedure TForm1.Button2Click(Sender: TObject);
var
par:variant;
ds:cmapxdataset;
bindlayerobject:bindlayer;
begin
par:=createoleobject('mapx.odbcqueryinfo.4');
par.SqlQuery := 'select test.longitude,test.latitude from test;';
par.DataSource := 'test';
par.ConnectString := 'Provider=MSDASQL.1User ID=jiordano;Data Source=test;DSN=test;DBQ=C:/DOCUMENTS AND SETTINGS/IAMCY/桌面/POJECT/test;DriverId=25;FIL=MS Access;Initial Catalog=C:/DOCUMENTS AND SETTINGS/IAMCY/桌面/POJECT/test';
BindLayerObject:= CoBindLayer.Create;
BindLayerObject.LayerName := 'mytab';
BindLayerObject.FileSpec := 'e:/incoming/project/map/map/mytab.tab';
BindLayerObject.refcolumn1:='longitude';
//excel中的坐标
BindLayerObject.RefColumn2 :='latitude';
//
BindLayerObject.LayerType := miBindLayerTypeXY;
ds:=Map1.Datasets.Add(miDatasetODBC, par, 'mytab', 'longitude', 'latitude', BindLayerObject, EmptyParam,false);
请问错在何处?