阅读:2033回复:3
Delphi Example of a Delphi Dataset
{ 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; |
|
|
1楼#
发布于:2003-09-04 10:50
绑定图层
|
|
|
2楼#
发布于:2003-11-27 20:22
谢谢
|
|
3楼#
发布于:2006-07-26 08:54
<P>楼主 名字好熟悉 </P>
|
|