Link to home
Start Free TrialLog in
Avatar of Eric Kay
Eric Kay

asked on

Creating Tables without OWNERS

How do I create a table in a unit (not a form)? When I try the following:-
var
    TableDefaults: TTable;
begin
    TableDefaults              := TTable.Create(Self);
I get an error - Undeclared identifier 'Self'
Am I neglecting to put a unit in the uses clause?
ASKER CERTIFIED SOLUTION
Avatar of javiertb
javiertb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eric Kay
Eric Kay

ASKER

The following uses clause already exists:-
uses
  SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
The following uses clause already exists:-
uses
  SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
Someone has to own the TTable, I believe.

How about:

    TableDefaults := TTable.Create(Form1);

You might need Form1.Handle...whatver type self is.

If this works, please reject previous answer and invite me to repost this comment as an answer.
You have to do this:

   TableDefaults:=TTable.Create(TableDefaults);

This works.
I stand corrected...you got an answer that works...that's most important.
Helloooo, anybody there to grade the question?? 8-)