Problem importing data from xBase

Startbeitrag von Garry Allen am 15.03.2017 15:04

I have a very weird problem: I have to import data from an xBase app that allowed all kinds of errors to creep in so I have to import the data programmatically.
The problem is in the following section of code:
sTmpID = dsComp.COMP_ID
Info(sTmpID +" already on file")
// catch duplicate names
sTmpName = dsComp.Name
sTmpName += "** GA **"
RBL_COMP.NAME = sTmpName // Problem occurs here

dsComp is the xBase file and RBL_COMP is the HFSQL Classic file

The 1st 6 records import just fine. I have the debugger set to show dsComp.COMP_ID and RBL_Comp.COMP_ID and I am single stepping through the code.

On the 7th record both variables show AMER04 until the last line above runs and then RBL_COMP.COMP_ID magically changes to AMER02 (which has already been imported in record 4)

What can possibly cause this?


Hi Gary,

Your second call to HReadSeek is moving the record pointer in your RBL_COMP table - you could try using HSeekFirst instead to do your duplicate check without reading the orignal record.


von Ned! - am 16.03.2017 09:57
Thanks Ned - I should have noticed that - and I forgot that HSeek doesn't move the pointer.
Data Import is turning out to be the hardest part of this project, maybe because I'm relatively new at WinDev. I am constantly being tripped up by importing codes like "LYN 01" and running into integrity errors because there is a Code like "LYN&01" on file... or at least I think that is what is happening.

von Garry Allen - am 18.03.2017 14:44
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.