Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data corruption writing to Access Db

Status
Not open for further replies.

corsair2

IS-IT--Management
Feb 21, 2001
55
0
0
GB
Hi All!

has anyone ever come up against the following?

I have a Delphi program (D6) which reads an ASCII format file into the relevent fields of an in-memory ClientDataSet table - this bit works fine.
However, on applying the updates (to an MS Access table) the data is occasionally not inserted correctly - sometimes entire rows are missed, at other times the contents of individual fields may be missed.
I'ved stepped through the Delphi code line by line and thoroughly checked the data prior to applying the updates and was wondering if the problem was at the Access end?
Anyone experienced anything similar?

regards

Steve
 
How are you inserting the records into Access? Are you using ODBC, ADO or?
 
Thanks for the reply!
I'm using the BDE with an MSACCESS driver and alias.
 
Do the app make an explicit Post after each edit, insert, delete?
i.e.

begin
Table1.Edit;
Table1.Post;
end;

Sometimes the implicit Posts are not handled properly, such as putting a record in edit mode and them moving to another record. This usually calls a posts, but is not always reliable.
 
Hi,

I'm using the ApplyUpdates method of TClientDataSet to send batches of records held in memory to the Access Table via a DataSetProvider.
Records are sent in batches of 10 (8 rows per record) after which the ClientDataSet is emptied and the process starts again with a new set of records.
Hope this helps, thanks for the interest!
 
Do you receive any update errors back from the Provider after updates apply? What is the Result set that is returned?
Also, check to see if the first time you apply the updates if all changes are applied correctly. If it always works the first time, but after that, errors occur, it might be because the records in the Delta from the previous update are not getting flushed out. You may need to do an explicit i.e. - ClientDataSet1.Refresh; after the updates are applied successfully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top