Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 8 Jahren, 5 Monaten
Letzter Beitrag:
vor 8 Jahren, 5 Monaten
Beteiligte Autoren:
Joris, Fabrice Harari

Import DBF file

Startbeitrag von Joris am 30.12.2009 15:43

Hi there,

I want to program the import of a DBF file into our application.
Our customers receive a DBF file from their supplier with article information that must be copied into our article database. Our application uses the hyperfile database.

To achieve this, i need to know the table columns inside the DBF file. Therefore i have written a procedure that must return the field names inside the specified DBF file. (See below)

The problem is the HListItem command. It says that the table is not present in my analysis.
I suppose there must be another way to retrieve the items of this file?

//////////////////////////////////////////////////////////////////////////////////
PROCEDURE MF_GET_KOL_DBF(PsFileName,PsCols)
DBF_File is Connection
DBF_File..Provider = hNativeAccessXBase
DBF_File..User = ""
DBF_File..Password = ""
DBF_File..Source = PsFileName
DBF_File..Database = ""
DBF_File..Access = hOReadWrite

IF NOT HOpenConnection(DBF_File) THEN
Error("File could not be opened."+CR+HErrorInfo())
RESULT False
END

LsTable is string = ExtractString(HListFile(DBF_File),1,CR)
IF LsTable = "" THEN
Error("File has no content...")
RESULT False
END

PsCols = HListItem(LsTable)
RESULT True

//////////////////////////////////////////////////////////////////////////////////

Thanks for helping.

Joris.

Antworten:

Hi Joris...

if the file schema is always the same, the easiest way is to add the file in the analysis once and for all, as a dbf file (just drag it in there)...

You can then 'connect' the the physical file in your import process and manage it as if it was an HF one

best regards



von Fabrice Harari - am 30.12.2009 15:55
Thanks for your answer Fabrice,

The problem is the structure of the DBF file. it is supplied by a third partie. its file schema may change at any moment.

We have the possibility to import excel files, access files, XML files and CSV files in our article file. Therefore we have set-up a configuration window to specify the destination fields of the data etc.... So now i would like to integrate the import of any DBF file.

Best regards,

Joris.

von Joris - am 04.01.2010 08:43
Zur Information:
MySnip.de 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.