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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Amend Table Errors

Status
Not open for further replies.

MrM121

Programmer
Aug 21, 2003
83
GB
Hi, my question is quite straightforward really. I am trying to think of a way of importing data into a database, and then generating a list of error records, if there are any. However, I don't want any records appended (at all) if there are any error records.

Is there a way of 'cloning' the table to be appended, without the data, appending data here, then checking if there are any errors, if so, abort the whole process? If anyone has any suggestions, they would be greatly appreciated.

Thanks,

Nick
 
Hi

It depends on how you plan to do the import and what you mean by errors.

If you have a 'work' table which you initilly import the data into, you can then decide if to update the main table or not. The 'work' table can be predefined or can be created on the fly by copying the structure of the main table.

If you use DoCmd.TransferText, then any errors (ie where FORMAT of data does not match the expected format will be dumped into an erros table called PasteErros, so you could test for prescence of this table and then not update your 'main' table

If by Errors, you mean some form of logic which is unique to your application/data then you will need to write code and /or queries to identify the errors.

Hope this helps

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi, thanks for that. I think you hit the nail on the head with the transfertext statement. I was plannning on using DAO to "create a table", and then do the error checks by copying an existing table and importing.

Thanks for the advice,

Nick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top