Subject RE: [IBO] An example - please
Author Art Metz
SL,

Your questions are directed more towards the difference between
client/server and desktop. I urge you to buy the Getting Started Guide; to
go through the examples provided with IBO; and to start with the TIBO
components, which will be more familiar to you. (But do stay away from
TiboTable; use TiboQuery instead.)

To answer your specific question: In you Paradox application,

> The user presses the Add Button, enters data in the DBEdits, then
> either presses the Save or Cancel buttons. I can see my reading the
> posts that this IS NOT the way it should be handled with Interbase.
>
> Assuming the above form, how should the add be handled? When the
> user presses the Add Button, if I don't Append, what do I do?
>

I would put up a blank form with edit boxes, combo boxes, lookups, etc NOT
tied to the database. Don't Append until the user presses the Add button.
After you fill in the fields, Post. A Commit is also strongly recommended,
because C/S in general and IB in particular do not like lengthy
transactions.

If
* you are strongly tied to data-aware controls, or
* you have many lookups, or
* you have constraints and relationships among the fields (e.g.,
checking Zipcode against City/State); or
* you want to post many records at one time,

then you may want to use a TClientDataSet to hold data locally before
committing it. However, at this point, we're getting ahead of ourselves.

I hope this helps. For IB (not IBO) related questions, you may want to
subscribe to the ib-general or interbase NGs hosted by mers.com .

Art Metz
AMetz@...

> -----Original Message-----
> From: SLSolutions@... [mailto:SLSolutions@...]
> Sent: Monday, January 08, 2001 10:40 AM
> To: IBObjects@egroups.com
> Subject: [IBO] An example - please
>
>
> Hello:
>
> I am a total beginner at Interbase and IBO. I am converting
> Delphi5/Paradox applications to Delphi5/IBO/IB6. In reading the
> posts, I can see that I have a Paradox mindset. I have been trying,
> with no luck, to find a book on using Delphi/Interbase but until I
> do, I want to get off on the right foot. If someone could give me a
> basic example of how to properly code this using Interbase:
>
> Assume a basic file maintenance form where user can add, modify,
> delete records. I realize I could user a navigation bar and allow it
> to handle the adds, mods, delete, etc but for learning purposes, I
> would like to handle this myself.
>
> On my form I have 4 buttons. Add, Modify, Save, Cancel. I also have
> numerious DBEdits linked to the various fields in my table. In my
> Paradox verison my database logic is as follows:
>
> Add Button:
> Append;
>
> Modify Button:
> Edit;
>
> Save Button:
> Post;
>
> Cancel Button:
> Cancel:
>
> The user presses the Add Button, enters data in the DBEdits, then
> either presses the Save or Cancel buttons. I can see my reading the
> posts that this IS NOT the way it should be handled with Interbase.
>
> Assuming the above form, how should the add be handled? When the
> user presses the Add Button, if I don't Append, what do I do?
>
> Any example would be greatly appriciated.
>
> Thanks.
>