Subject | Re: [IBO] Philosophy of using IBObjects |
---|---|
Author | Helen Borrie |
Post date | 2001-07-10T00:15:25Z |
At 06:22 PM 09-07-01 +0000, you wrote:
Are you using Insert or Append?
A generator can be used to ensure you get a unique number to use as a primary key value. Is your primary key an integer type ? Have you defined a generator for it? Do you have a Before Insert trigger for it?
If you do have this structure in place, you can use the GeneratorLinks property to bring the new generator value across to new inserts automatically. You don't need locks to insert a row with a generator primary key. It is guaranteed to be unique and this uniqueness is not affected by other users.
Please confirm that you are >>not<< trying to use TIBTable with IBO. (This component belongs to IBX and cannot be mixed with IBO components). You need TIBODatabase and TIBOTable or TIBOQuery. Use the VCL controls and use TDatasource to link the TIBO objects to them.
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Sorry for maybe trivial questions (and my english)You do mean TIBOTable, right?
>
>Problem is:
>I'am translating my programs to IB from DBF. If someone can help to
>solve few basic problems I'll be very ....
>I start to try TIBTable first.
>Problems:The first thing to do is get your KeyLinks right. It needs to be one line for each column of the primary key.
>1. how can I add record to dataset, post it and keep that record
>active (to make some other operations - like print form etc.)
>2. what can I do to keep position in dataset when other users areIf other users are adding new data you won't see them until your own work is committed and you refresh your table.
>adding new data -
>I want to see it but stay at previous position inTriggers work on the server, not in your client app. There is no physical ordering of rows on the server such as you have been used to in dBase. New rows are placed anywhere in the database file where there is space - on a new page, if necessary.
>grid. I try it with triggers
> but not everytime bookmark createdIf your KeyLinks are correct, the bookmarks will be correct. IBO uses the KeyLinks to create the bookmarks. It also uses them for the repositioning of the cursor after the refresh. The default behaviour of Insert is to position the cursor at the same row it was on before the dataset entered Insert mode and to show the new row before it.
>automatically by IBO is valid - then I can't keep positioning on same
>record
Are you using Insert or Append?
>3. I have to write to database positions of one document ex. ordersCan you explain this more? I don't understand this description.
>with one unique symbol and number and different positions with it.
>How to make it (special generator procedure or lock table for thisIn InterBase you don't lock tables (except in very rare conditions). One user's work is isolated from others by the isolation level of the transaction. In the TIBO scenario, the default isolation level is tiConcurrency.
>moment) ?
A generator can be used to ensure you get a unique number to use as a primary key value. Is your primary key an integer type ? Have you defined a generator for it? Do you have a Before Insert trigger for it?
If you do have this structure in place, you can use the GeneratorLinks property to bring the new generator value across to new inserts automatically. You don't need locks to insert a row with a generator primary key. It is guaranteed to be unique and this uniqueness is not affected by other users.
>4. When I try to use KeyLinks to position in dataset I often have notIF your table has a primary key, then let the KeyLinks be autocreated.... If it doesn't, you must set up KeyLinks to be the column or group of columns that identifies a row of your table uniquely.
>valid record identyfication for change data - when KeyLinks is auto
>created this problem is not present.
Please confirm that you are >>not<< trying to use TIBTable with IBO. (This component belongs to IBX and cannot be mixed with IBO components). You need TIBODatabase and TIBOTable or TIBOQuery. Use the VCL controls and use TDatasource to link the TIBO objects to them.
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________