• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

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?
0
Eric Kay
Asked:
Eric Kay
  • 3
  • 2
  • 2
1 Solution
 
javiertbCommented:
You have to include 'DbTables' unit in your uses clause.
0
 
Eric KayAuthor Commented:
The following uses clause already exists:-
uses
  SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
0
 
Eric KayAuthor Commented:
The following uses clause already exists:-
uses
  SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mheacockCommented:
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.
0
 
javiertbCommented:
You have to do this:

   TableDefaults:=TTable.Create(TableDefaults);

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now