袁绍伦
路人甲
路人甲
  • 注册日期2003-08-08
  • 发帖数654
  • QQ164646905
  • 铜币1336枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2033回复:3

Delphi Example of a Delphi Dataset

楼主#
更多 发布于:2003-09-03 21:39
{ In order to create a Delphi Dataset, do the following steps:
  1. Add a data source (such as a Table or Query control) to the
     Delphi form and point it to the appropriate BDE data source
     by setting its DatabaseName and TableName properties.
     Set its Active property to True to open the database.
  2. Add a DataSource control to the form. Set its DataSet
     property to whichever control you created in step 1.
  3. Select View -> Project Manager in the menu.

  4. Right click on the .exe of your project in the
     Project Manager window, and select View Source.
  5. Insert the line "ShareMem" directly after the "uses"
     line in the source window.
  6. Save the project, and proceed as normal. The example
     code below can be used to create a MapX dataset.
}

procedure TMapForm.DelphiDSClick(Sender: TObject);
var
 SourceData: OLEVariant;
 ds: MapXLib_TLB.Dataset;
begin
 TVarData(SourceData).vType := varByRef;

 TVarData(SourceData).vDispatch := DataSource1;

 try
  { Create a dataset and theme from the Delphi dataset. }
  ds := Map1.Datasets.Add(miDataSetDelphi4, SourceData,
   'TestDS','GEOABBR', EmptyParam, EmptyParam, EmptyParam,
   EmptyParam);
  ds.Themes.Add(miThemeRanged, 'TOTPOP', EmptyParam, EmptyParam);
 except
  on E: EOleException do
   Application.MessageBox(PChar(E.Message), 'Error',
    MB_OK or MB_ICONERROR);
 end;
end;
喜欢0 评分0
愿意和大家交朋友! QQ:47559983 MSN:shaolun_yuan@hotmail.com eMail:shaolun-yuan@163.com
happyboy75
路人甲
路人甲
  • 注册日期2003-07-27
  • 发帖数89
  • QQ
  • 铜币667枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2003-09-04 10:50
绑定图层
想换工作:现在的工作有点偏离GIS 求职意向:GIS应用与开发(mo、mapx、mapengine) 开发语言:vb、delphi 数据库:SQL server、DB2 happyboy075@163.com qq:122761955
举报 回复(0) 喜欢(0)     评分
xiaonai
路人甲
路人甲
  • 注册日期2003-11-27
  • 发帖数87
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2003-11-27 20:22
谢谢
举报 回复(0) 喜欢(0)     评分
lizehua1394
路人甲
路人甲
  • 注册日期2006-02-21
  • 发帖数76
  • QQ
  • 铜币19枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2006-07-26 08:54
<P>楼主 名字好熟悉 </P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部