0

I am trying to create a form dynamicly and thus I need to initialize my DBGrid with code.

{ Connect the DBGrid to the database. }
procedure TfrmRemoveRecord.InitDBGrid();
begin
  dbgList.DataSource := dmProgramDatabase.dsrCaches;
end;

But I get an access violation error.

2
Contributors
3
Replies
18
Views
2 Years
Discussion Span
Last Post by MasterHacker110
1

What is dmProgramDatabase? My guess is that it is a data module and you have not created it before InitDBGrid is called.

0

Solved the issue. I needed to call the initialization in the OnActivate and not in the OnCreate of the form.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.