 |
|
 |
|
Next: Formatting pushbutton text
|
| Author |
Message |
External

Since: Aug 17, 2008 Posts: 7
|
(Msg. 1) Posted: Sun Aug 17, 2008 3:12 pm
Post subject: Help with Paradox 9 table schema Archived from groups: comp>databases>paradox (more info?)
|
|
|
I'm a total newbie to Paradox and I need some help creating my
database tables. I work with Paradox 9 through Borland C++ Builder
2006. I want to have two database tables, one called Transactions and
another called TransactionDetails. Transactions has primary key
TransactionID, which is an ftString. TransactionDetails has a primary
key (TransactionID, TransactionAccountType) and both are strings.
Now, I want to make TransactionDetails be a child of Transactions so
that:
1. I cannot add a record to Transactions without first adding it to
TransactionDetails.
2. When I update a record in the Transactions table, the corresponding
record in TransactionDetails (i.e. the records with the same
TransactionID number) will also be updated. For example, if I go into
Transactions and change a record's TransactionID number from 1111 to
2222, it will automatically search in TransactionDetails for all
records that have a TransactionID number of 1111 and change those to
2222 automatically.
How do I form these two tables?
As it is now, I have C++ code that creates the two tables:
////////// CODE BEGINS HERE //////////
// create parent table
TTable* taTransactions = new TTable(this);
taTransactions->DatabaseName = "C:\\temp";
taTransactions->TableType = ttParadox;
taTransactions->TableName = "Transactions.db";
taTransactions->FieldDefs->Clear();
taTransactions->FieldDefs->Add("TransactionID", ftString, 10, true);
taTransactions->FieldDefs->Add("TransactionDate", ftDateTime, 0,
true);
taTransactions->FieldDefs->Add("TotalAmount", ftCurrency, 0, true);
taTransactions->IndexDefs->Clear();
taTransactions->IndexDefs->Add("", "TransactionID",
TIndexOptions()<<ixPrimary);
// create child table
TTable* taTransactionDetails = new TTable(this);
taTransactionDetails->DatabaseName = "C:\\temp";
taTransactionDetails->TableType = ttParadox;
taTransactionDetails->TableName = "TransactionDetails.db";
taTransactionDetails->FieldDefs->Clear();
taTransactionDetails->FieldDefs->Add("TransactionID", ftString, 10,
true);
taTransactionDetails->FieldDefs->Add("TransactionAccountType",
ftString, 5, true);
taTransactionDetails->FieldDefs->Add("TransactionType", ftString, 5,
true);
taTransactionDetails->FieldDefs->Add("AmountReceived", ftCurrency, 0,
true);
taTransactionDetails->FieldDefs->Add("AmountDisbursed", ftCurrency, 0,
true);
taTransactionDetails->FieldDefs->Add("AccountNumber", ftString, 8,
true);
taTransactionDetails->FieldDefs->Add("PersonID", ftString, 10, true);
taTransactionDetails->FieldDefs->Add("Percent", ftFloat, 0, true);
taTransactionDetails->IndexDefs->Clear();
taTransactionDetails->IndexDefs->Add("",
"TransactionID;TransactionAccountType", TIndexOptions()<<ixPrimary);
taTransactions->CreateTable();
taTransactionDetails->CreateTable();
// delete pointers
delete taTransactions; taTransactions = 0;
delete taTransactionDetails; taTransactionDetails = 0;
////////// CODE ENDS HERE //////////
Problem is I don't quite have it yet. There's no "link" between
Transactions and TransactionDetails. I know there's a much MUCH easier
way to do this via the Paradox 9 program instead of C++.
Unfortunately, I don't really know how to use that. Can anybody help
me? >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Feb 25, 2004 Posts: 48
|
(Msg. 2) Posted: Sun Aug 17, 2008 4:22 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
This appears to be a C++ question, rather than a Paradox question.
Althogh you mention 'Paradox 9' (?).
While someone may be able to help you here, you may be better served
asking this on a C++ forum.
> way to do this via the Paradox 9 program instead of C++.
> Unfortunately, I don't really know how to use that. Can anybody help
> me?
Well, getting a C++ answer will be a LOT easier than starting from
scratch with Paradox the Application.
--
------------------------------
Tony McGuire >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Jan 10, 2008 Posts: 49
|
(Msg. 3) Posted: Sun Aug 17, 2008 6:31 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
as Tonty said, these are C+ questions.. the table format isn't the issue,
it's the platform you use.. always ask questions to the people using your
native platform..
however, your game-plan has flaws, no matter what platform:
> so that I cannot add a record to Transactions without first adding it to
> TransactionDetails.
that's backwards, but I think this was a typo.. if not, it's definitely
problematic.. you *always* create the master first..
> 2. When I update a record in the Transactions table, the corresponding
> record in TransactionDetails (i.e. the records with the same TransactionID
> number) will also be updated.
serious design flaw here.. the primary key should never change.. its either
a sequential value, or a system-generated value.. it's not user-defined,
and should *never* change..
--
Steven Green - Myrtle Beach, South Carolina USA
Diamond Software Group
http://www.diamondsg.com/main.htm
Paradox Support & Sales
Diamond Sports Gems
http://www.diamondsg.com/gemsmain.htm
Sports Memorabilia and Trading Cards >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Jul 22, 2004 Posts: 36
|
(Msg. 4) Posted: Mon Aug 18, 2008 10:52 am
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
wrote:
> I'm a total newbie to Paradox and I need some help creating my
> database tables.
Why are you using Paradox tables with BC++?
The code you've shown creates the tables. Even if you figure out how to add
the Referential Integrity as part of this code, or with Paradox, you won't
get the cascading update you're looking for. I think that is the simple
answer to your question.
The only way to get this sort of behavior against Paradox tables is to
include this logic in your application behavior -- which also means you
cannot rely on it.
So my question about why Paradox is based on two facts:
(1) There are other RDBMSs that do support cascading RI -- why not use one
of them instead?
(2) The BDE and the Paradox table format are deprecated
--
Larry DiGiovanni >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Jun 07, 2008 Posts: 15
|
(Msg. 5) Posted: Mon Aug 18, 2008 12:10 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Sun, 17 Aug 2008 15:12:16 -0700 (PDT),
wrote:
>. There's no "link" between
> Transactions and TransactionDetails. I know there's a much MUCH easier
> way to do this via the Paradox 9 program instead of C++.
> Unfortunately, I don't really know how to use that.
What Larry said. Plus, I though I'd actually answer your question! ;-}
Yes, there is a much easier way to do this in PDox9. If you create your app
wholly within Pdox9, and abandon C++ altogether, creating tables with RI is
trivial -- but comes with *BIG* potential problems.
First, here's how you do it. Create the two tables using File/New/Tables --
the dialog is self-explanatory. Be sure to create the primary index by
putting the index fields first and putting an asterisk in front of them
(this will be clear when you see the dialog). NOW, re-open this dialog for
the subtable -- you do this with Tools/Utilities/Restructure. The far right
tab is "Referential Integrity". Use this to link it to the parent table.
That's it!
Now for the problems. Paradox is the Tounces of the RI world. It does it --
just not very well. The big problem is that the table directory paths are
HARD CODED into the structure, right down to the drive letter. If you move
either table, your whole application breaks. This makes Paradox RI
effectively undeliverable. For a one-person standalone application it does
what you want -- until you decide to buy a new computer. Then you have to
EXACTLY duplicate the drive and directory structure on the new machine. And
don'd even THINK about rearranging your hard drive.
Most of us just do RI in code, which is pretty easy once you are used to
Paradox's powerful language, OPAL, specifically structured for a RAD
database environment.
And that's the second problem: OPAL is a very odd language, and C++ by
itself will only help you a little. OPAL uses pointers a lot, much like
C++; but it is designed to look like Pascal; and it is event-driven, like
JavaScript in a browser. You cannot create new classes or objects
programmatically. Instead, you define all your objects interactively, then
hang code onto them ONLY as it is needed to modify their default behavior.
The trick is to learn the default behavior (which is VERY subtle and
complex) and only then learn what code you need to change this.
The reward: once you internalize this, Paradox is the ultimate RAD (except
for the RI problem of course). But, as both OPAL and the BDE have been
deprecated, is it worth your while? Did I mention that Paradox does not
have a Vista-ready version?
If your choice is learning Paradox from scratch vs Access or Foxpro,
Paradox is, IMHO, the better choice -- simpler and more powerful despite
its problems. But that's not your choice, is it?
--
HTH
Jim Hargan >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Aug 17, 2008 Posts: 7
|
(Msg. 6) Posted: Mon Aug 18, 2008 3:44 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 18, 12:10 pm, Jim Hargan wrote:
> First, here's how you do it. Create the two tables using File/New/Tables --
> the dialog is self-explanatory. Be sure to create the primary index by
> putting the index fields first and putting an asterisk in front of them
> (this will be clear when you see the dialog). NOW, re-open this dialog for
> the subtable -- you do this with Tools/Utilities/Restructure. The far right
> tab is "Referential Integrity". Use this to link it to the parent table.
> That's it!
After testing this on two of my tables, this approach appears to have
worked. I can change the ID field in one table, and that automatically
updates the corresponding records in the child table. Thank you very
much. Now if I could get it working through C++ I'd really be cooking.
> Most of us just do RI in code, which is pretty easy once you are used to
> Paradox's powerful language, OPAL, specifically structured for a RAD
> database environment.
>
This OPAL language sounds interesting. Do you know if there's any way
I can integrate this into a Borland C++Builder application?:Where else
can I learn abouit OPAL? I've never even heard of it. There doesn't
even seem to be a Wikipedia article on it. >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Aug 17, 2008 Posts: 7
|
(Msg. 7) Posted: Mon Aug 18, 2008 3:49 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 17, 6:22 pm, "Tony McGuire" wrote:
> While someone may be able to help you here, you may be better served
> asking this on a C++ forum.
>
Unfortunately, the Borland C++ newsgroups are nowhere near as populous
as these Paradox newsgroups are. This question here has gotten 11
replies, and I asked pretty much the same question at
borland.public.cppbuilder.language.cpp and I haven't gotten a single
reply. >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Aug 17, 2008 Posts: 7
|
(Msg. 8) Posted: Mon Aug 18, 2008 3:58 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 18, 10:52 am, "Larry DiGiovanni" wrote:
>
> Why are you using Paradox tables with BC++?
>
I inherited an old C++ Builder application that has been using
numerous different Paradox tables for different branches of our
company for years. My job is to take these tables and move them into
two big gigantic tables (one child, one parent) in a MySQL database.
One of the necessary steps is modifying the ID numbers for both parent
and child tables to better prepare them for the MySQL migration. If I
only have to update the ID numbers in the parent table (child's ID
numbers will update through referential integrity) this will be a
significant timesaver.
> The code you've shown creates the tables. Even if you figure out how to add
> the Referential Integrity as part of this code, or with Paradox, you won't
> get the cascading update you're looking for. I think that is the simple
> answer to your question.
>
> The only way to get this sort of behavior against Paradox tables is to
> include this logic in your application behavior -- which also means you
> cannot rely on it.
>
> So my question about why Paradox is based on two facts:
>
> (1) There are other RDBMSs that do support cascading RI -- why not use one
> of them instead?
> (2) The BDE and the Paradox table format are deprecated
"deprecated"? >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Aug 17, 2008 Posts: 7
|
(Msg. 9) Posted: Mon Aug 18, 2008 4:41 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 18, 7:27 pm, "Steven Green" wrote:
> might just be a timing issue.. overall, the borland groups are great.. the
> paradox group evolved from borland groups, when paradox was part of
> borland.. right now, all the old borland groups got axed, and the new
> embarcadero groups just started as the replacement..
what's "embarcadero"? >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Feb 25, 2004 Posts: 48
|
(Msg. 10) Posted: Mon Aug 18, 2008 6:34 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Deprecated means no longer used (going forward) and no longer
supported (by the company that created/owns it).
Embarcadero is the company that bought 'Borland'. All the development
tools, anyway. Not sure if they bought the name as well.
The remainder company that WAS Borland is delving into Witchcraft, or
Gaea worship .. or something.
------------------------------
Tony McGuire >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Aug 17, 2008 Posts: 7
|
(Msg. 11) Posted: Mon Aug 18, 2008 7:08 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Aug 18, 8:34 pm, "Tony McGuire" wrote:
> Deprecated means no longer used (going forward) and no longer
> supported (by the company that created/owns it).
>
> Embarcadero is the company that bought 'Borland'. All the development
> tools, anyway. Not sure if they bought the name as well.
>
> The remainder company that WAS Borland is delving into Witchcraft, or
> Gaea worship .. or something.
>
> ------------------------------
> Tony McGuire
This is interesting. So does this mean that C++ Builder and Delphi are
becoming obsolete? >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Jan 10, 2008 Posts: 49
|
(Msg. 12) Posted: Mon Aug 18, 2008 7:25 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Jan 10, 2008 Posts: 49
|
(Msg. 13) Posted: Mon Aug 18, 2008 7:27 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> Unfortunately, the Borland C++ newsgroups are nowhere near as populous as
> these Paradox newsgroups are
might just be a timing issue.. overall, the borland groups are great.. the
paradox group evolved from borland groups, when paradox was part of
borland.. right now, all the old borland groups got axed, and the new
embarcadero groups just started as the replacement..
--
Steven Green - Myrtle Beach, South Carolina USA
Diamond Software Group
http://www.diamondsg.com/main.htm
Paradox Support & Sales
Diamond Sports Gems
http://www.diamondsg.com/gemsmain.htm
Sports Memorabilia and Trading Cards >> Stay informed about: Help with Paradox 9 table schema |
|
| Back to top |
|
 |  |
External

Since: Jan 10, 2008 Posts: 49
|
(Msg. 14) Posted: Mon Aug 18, 2008 7:28 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
External

Since: Jul 22, 2004 Posts: 36
|
(Msg. 15) Posted: Mon Aug 18, 2008 8:05 pm
Post subject: Re: Help with Paradox 9 table schema [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
| Related Topics: | write to paradox via web - I have a client that uses software developed in delphi. It uses paradox database files. Can these be written to from the web? I am familiar with php/mysql...is there a similar capability with delphi/paradox?
Paradox indexes - Can someone tell me how to find the indexes being used in a .db file?? many thanks
Paradox Versions - Could someone let me know which is the latest version of the Paradox? I have purchased Corel Office X3 Professional with Paradox version 11.0.0.411. I hear talks about versions 12 and even 13. Do they really exist? How can they be obtained? Regards, Chri...
Paradox and Vista - I tried Paradox Runtime 9 on MS Vista last year and kept getting an error on exiting Paradox. It just says that PF Runtime has stopped working.....Windows is collecting information. Few seconds later, I just hit the CLOSE PROGRAM. Today I tried..
Source for Paradox 4.5 DOS & SQL Link - Does anyone out there know of a source for obtaining Paradox 4.5 for DOS and SQL Link? I spent about 4 years doing Paradox development in the early 90s, and have found some of my Paradox->SQL applications which I would like to get running. .. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|