Subject Re: [IBO] loosing records Help
Author TeamIBO
> here is basically the code in a close event;
...

There are lots of issues that I could raise with this code, not least
of which is question why you are not using data aware controls to feed
the table records more directly. But lets avoid all that for the
moment...

Here is a pseudo version of your code, to try and see what you
are doing...

start editing table1 // (1)
assign one field // (2)
if user confirms then
begin
assign more fields
post the record
start inserting to table1
assign lots offields
post the record
end
else
begin
assign another field // (3)
end

One thing that becomes more obvious in this cut down version is that
you do NOT post the field assignments indicated as (2) and (3) above.
So whatever you expected to happen there will not happen. Indeed the
call to edit should be moved inside the confirm block.

When you start editing (1), how do you know what record you are
editing?


> where/how would I make sure that this commits to the database table?
> there is a CommitAction property on IBOTable1 set to
> caValidateCursor?

From the sounds of things you are relying on the default transaction
inside TIBODatabase. Presumably you have IBODatabase.AutoCommit set to
true? If not then you need to call IBODatabase.Commit; at the end of
the above.


> the users have reported some ISC errors but I was trying to capture
> them, but don't know how to resume operation;

Some of these errors could be coming from inappropriate ways of
constructing and destroying forms and datamodules. Without seeing all
of your application it is difficult to say for certain.

For example you mention that the above code is in an OnClose event for
a form - given the prompting I would have expected that you would have
used OnCloseQuery and given a cancel option to abort the close.
Exceptions occuring inside the OnClose event could have unpredictable
results. However there is not enough of your application there to see
exactly what you are doing and how that may generate the errors we are
seeing.

The network errors could be almost anything. Bugs in your app,
network problems, the server aborting. To check for server aborts
look at the Interbase.log file in the firebird installation directory
on the server.

The error with the IP control (wwcombobox) is strange, perhaps it is
as a result of some other error or perhaps there is a bug in the IP
code, I have no way to tell.


Not sure how much help this is, without understanding more of the
application it is difficult to be more specific.

--
Geoff Worboys - TeamIBO
Telesis Computing