Solved

Creating Tables without OWNERS

Posted on 1997-04-17
7
215 Views
Last Modified: 2010-04-04
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
Comment
Question by:Eric Kay
  • 3
  • 2
  • 2
7 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 50 total points
ID: 1335429
You have to include 'DbTables' unit in your uses clause.
0
 

Author Comment

by:Eric Kay
ID: 1335430
The following uses clause already exists:-
uses
  SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
0
 

Author Comment

by:Eric Kay
ID: 1335431
The following uses clause already exists:-
uses
  SysUtils, StdCtrls, DB, Dialogs, Forms, DBTables, ExtCtrls, Classes;
however it still doesn't work.
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 3

Expert Comment

by:mheacock
ID: 1335432
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
 
LVL 2

Expert Comment

by:javiertb
ID: 1335433
You have to do this:

   TableDefaults:=TTable.Create(TableDefaults);

This works.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335434
I stand corrected...you got an answer that works...that's most important.
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335435
Helloooo, anybody there to grade the question?? 8-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Path  to current project in Delphi. 2 92
Reconfigure Delphi Install? 2 60
select query - oracle 16 100
how to update exe applicatio from internet ? 6 87
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question