Help: Lost Data / TBDEDataSet.Handle 
Author Message
 Help: Lost Data / TBDEDataSet.Handle

My problem is that I am losing data from a table. (Bear with me, this is
going to be a long one).

I have an array of tables, lets call them
DataTbl: array[1..10] of TTable

I am writing data to them periodically from my program. What I see is
that I can write data to the table, even see the data in there with
DBD, for example, and then when I close my program, the data is gone. I
had the same problem before when I had only one table and I fixed it by
using DBISaveChanges(DataTbl.Handle) in the AfterPost method. Now that I
have an array of tables, I tried the following:

for j := 1 to DataTableCount do
  Check(DBISaveChanges(DataTbl[j].Handle);

The problem is that this code sometimes chokes on the second table with
an error message like "Invalid Handle". So, I put in code to check
for a nil handle like this:

for j := 1 to DataTableCount do
  if DataTbl[j].Handle <> nil then
    Check(DBISaveChanges(DataTbl[j].Handle);

This one does not give the error message, but it's not running the
DBISaveChanges method for all three tables and sometimes, I step through
the code in debug and the Handle value (e.g. $1CB838B) is the same for
all three tables in the array. When this is the case, it runs without an
error. Can anybody give me some insight as to how the Handle is used and
how to save my data without losing it?

Thanks a lot.

Joel

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help : error COM1 "data lost"

2. Help) How to set TBDEDataSet.Filter string?

3. Losing File Handles - But I am not using Files

4. Paradox tables losing data

5. Losing Data

6. Delphi 2.0 (32 bit) Losing data

7. Delphi 4 - Paradox, lose of data

8. Paradox v7 Tables loses Data

9. Losing data with BDE and Delphi 3

10. Losing data...

11. - Paradox 7 lost data in memo fields - why ?

12. Why do i lose my data ?

 

 
Powered by phpBB® Forum Software