?
Solved

Creating Tables without OWNERS

Posted on 1997-04-17
7
Medium Priority
?
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 100 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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