Solved

Creating Tables without OWNERS

Posted on 1997-04-17
7
224 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 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
Independent Software Vendors: 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

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!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 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