开发者

How to get dataset to populate data into dbgrid in Delphi 6?

I have created a DBGrid in Delphi 6 and tied it to a DataSource contained in a DataModule. The Dataset for that source in also located in the same module. In the OnShow event for the form, I activate the dataset and set a label equal to the rowcount for the dataset. This shows several hundred rows but nothing shows in the dbgrid. If I activate the dataset in the IDE, the grid populates with the expected data. Does anyone have any idea why this behaviour would change between the IDE and normal runtime? We are also using SDAC connection components.

All 3rd party component choices are not mine to change.

I can elaborate as necessary for clarificat开发者_运维百科ion, but I mainly need troubleshooting ideas to start at.


I have observed many times in D6 that the data controls can lose their settings at runtime, particularly the ones that associate one control with another. You might like to try setting the relevant names explicitly in your OnShow code before activating the data source.


I haven't been working with delphi for a few years, but I remember that the datasource property sometimes get lost if the dataset is kept active = true in design time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜