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

How to check a table for existing values

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

I'm currently apphending a table using the coding below:

dt.SetSource ( "RouteSave.db" )
if dt.getSourceType ( ) = DTASCIIFixed Then
dt.loadDestSpec ( "SpecTable" )
endIf
dt.setDest ( "FinalRoute.db" )
if not dt.getAppend () then
dt.setAppend ( True )
endif
dt.transferData ( )


However, I want to write some code checking the table "FinalRoute.db" to see if the data I'm saving there is already present. If it is the user should get the choise of whether to replace the existing data or cancel the save.

Any ideas anyone?

Thanks,

Woody.
 
Woody,

The easiest way to do this is manually:

1. Import your data into a copy of the final table structure

2. Query (or range) the duplicate records out of the imported table.

3. Display those results to the user for their choices.

4. Append the non-duplicate data and the selected duplicate data into the original table.

It take a bit of time to set up, but once you've got it, you have full control over the entire process.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top