PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Importing data from DBF file to HFSQL file is not successful
Importing data from DBF file to HFSQL file is not successful
Débuté par Cyril Fernandes, 26 déc. 2024 00:25 - 2 réponses
Posté le 26 décembre 2024 - 00:25
BILL.DBF IS dbase/Foxpro file

BILLFILE is HFSQL file

Only a few number of records are added into HFSQL file

I'm using WEBDEV 20 Version

HERE'S THE CODE:

HDBOpenNoLock("BILL", "BL", "D:\LANSOC\UP\97-98\BILL.DBF")

HReadFirst("BILL")

WHILE NOT HOut("BILL")

HCopyRecord("BILLFILE","BILL")

HAdd("BILLFILE")

Entry_No = HRetrieveItem("BILL", 1 )
From_Date = HRetrieveItem("BILL", 5 )
To_Date = HRetrieveItem("BILL", 6 )

BillFile.FromDate = From_Date
BillFile.ToDate = To_Date
BillFile.EntryNo = Entry_No

HModify("BILLFILE")

HReadNext("BILL")
END

HClose("*")
Membre enregistré
155 messages
Posté le 26 décembre 2024 - 14:24
Hello

I see your problem, you forgot a search code

In your code, you skipped a line before the modification

You will need to check and add the following program:

Entry_No = HRetrieveItem("BILL", 1 )
From_Date = HRetrieveItem("BILL", 5 )
To_Date = HRetrieveItem("BILL", 6 )

// EDD (12/24) This is where you insert this program
HReadSeek(BILLFILE, Identifier, BILLFILE.Identifier)
IF HFound(BILLFILE) = True THEN
BillFile.FromDate = From_Date
BillFile.ToDate = To_Date
BillFile.EntryNo = Entry_No
IF HModify("BILLFILE") = False THEN
Error(ErreurInfo(errComplet))
EndProgram()
END
END

NB: Each time new information don't forget to add the HReadSeek() program

Best regards
Mr.RATSIMANDRESY
Niry Aina Eddy
Posté le 29 décembre 2024 - 02:50
Niry Aina Eddy RATSIMANDRESY wrote:
Hello

I see your problem, you forgot a search code

In your code, you skipped a line before the modification

You will need to check and add the following program:

Entry_No = HRetrieveItem("BILL", 1 )
From_Date = HRetrieveItem("BILL", 5 )
To_Date = HRetrieveItem("BILL", 6 )

// EDD (12/24) This is where you insert this program
HReadSeek(BILLFILE, Identifier, BILLFILE.Identifier)
IF HFound(BILLFILE) = True THEN
BillFile.FromDate = From_Date
BillFile.ToDate = To_Date
BillFile.EntryNo = Entry_No
IF HModify("BILLFILE") = False THEN
Error(ErreurInfo(errComplet))
EndProgram()
END
END

NB: Each time new information don't forget to add the HReadSeek() program

Best regards
Mr.RATSIMANDRESY
Niry Aina Eddy


********************

Hi,

I tried the modification suggested by you. It's not working.

Its adding 67 records out of 804 records

Thanks