Duplicate Key Problem with TPS File 
Author Message
 Duplicate Key Problem with TPS File

I'm trying to fix a TPS database that got corrupted due to bad
sectors on the hard drive.  TPSFIX tells me at the end of the
error checking that "Build of keys failed due to duplicate keys
being generated."  Sounds like the TPS file has two records
with the same value for the Primary Key.  Anybody have a
technique for fixing that type of problem?  I'll probably have to
write a program that searches the data file for duplicate keys
and deletes one of the records with the duplicate key values.
Any suggestions would be appreciated.

David J. Owens



Tue, 28 Jan 2003 03:00:00 GMT  
 Duplicate Key Problem with TPS File
File manager (www.capesoft.com) has a feature to fix this (called
freshen), however you lose the duplicate records, which may not please
you depending on the situation.

---
Mark Riffey
Granite Bear Development
http://www.granitebear.com

Software for professional photography studios
and non-profit organizations



Tue, 28 Jan 2003 03:00:00 GMT  
 Duplicate Key Problem with TPS File
David,

[pseudo code]
NewFile   LIKE(OldFile)

  Create(NewFile)
  Open(NewFile)
  Open(OldFile)
  Set(OldFile)
  Loop
     Next(OldFile)
     If ErrorCode() then break .
     !
     NewFile = OldFile
     Add(NewFile)
     If ErrorCode() = DupKeyErr
       Do ReAutoIncNewFile
     End
  End

You won't loose any records this way.
If you have more than 1 unique key, the error-
checking must be extended.
(Add Stream/Flush to run this code 10 times faster)

--
Best regards,
Maarten
C5EEb - ABC & C5.5b2
Certainly Clarion Developer



Tue, 28 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. TPS file duplicate key error

2. TPS file recovery utility/TPS ODBC problem

3. BUILD() and Duplicate Key Problems

4. Duplicate key problem

5. Duplicate KEY entry problem

6. LAN and TPS files with dynamic index keys

7. Foreign characters in key-field of TPS file.

8. CW2001.01 Search for number key using GET(file,key) PROBLEM

9. Problems using keys with files in TOPSPEED files

10. Looking for TPS file W/O TPS Estention

11. TPS file performance problems & missing message thread

12. NT 4.0 and TPS file locking problem

 

 
Powered by phpBB® Forum Software