Here is my solution how to import data from DBF with very little code.
I hope this will be very useful. I love to use it with Progress-Bar so I put code here
if you also love to see what happening with your data.
Button code, on click:
dsKontaQuery is Data Source
//Same name can not be for DBF and for one into analysis THEN alias will be KTA
HDBOpen("KTA","KTA","C:\IMPORT\KONTA.DBF")
sSql is string = "SELECT * FROM KTA"
IF NOT HExecuteSQLQuery(dsKontaQuery,hQueryDefault,sSql) THEN
ErrorInfo(errFullDetails)
END
HCreation(Konta)
TableDisplay(TABLE_Konta,taStart)
nUkupno is int = HNbRec(dsKontaQuery)
nRbr is int =0
PROGBAR_ProgressBar1..MinValue=0
PROGBAR_ProgressBar1..MaxValue=nUkupno
HReadFirst(dsKontaQuery)
WHILE NOT HOut(dsKontaQuery)
nRbr += 1
PROGBAR_ProgressBar1 = nRbr
Konta.Konto= dsKontaQuery.Konto
Konta.Naziv_Konta=NoSpace(dsKontaQuery.kon_naz)
HAdd(Konta)
HReadNext(dsKontaQuery)
END
TableDisplay(TABLE_Konta,taStart) //Re-display Table from start
And voila your DBF data are imported very very fast. Zooooomm.