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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The following uses clause already exists:-
uses
SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
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.
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.Crea te(TableDe faults);
This works.
TableDefaults:=TTable.Crea
This works.
I stand corrected...you got an answer that works...that's most important.
Helloooo, anybody there to grade the question?? 8-)
ASKER
uses
SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.