Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #13293
| From | JohnMartens <martens@tennishulp.info> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Does AppendDelimited needs to have installed some specific RDD or DLL file? |
| Date | 2021-03-27 08:22 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <s3mmgd$hm1$1@dont-email.me> (permalink) |
| References | <54c72ea6-efc1-4952-b19f-4a6e3ebb2af3n@googlegroups.com> |
Hi Juan,
To have a good check on the file stuct I always opened an CSV import
file and process it line by line so you can check on the numer of
fields, type of field, check the content, do the right type check etc
etc before putting the data in the data base.
More work that one line of append delimited but in the end you will need
the checks anyway
If you can get a DBF file as import in the right structure with sure
checks on the fields one can just loop trough the import file and copy
the data to the main DBF.
Here some lines of code that could help
John
get filename by user when a button on a window is clicked
oOpenDialog := OpenDialog{SELF,''}
oOpenDialog:InitialDirectory := cDirImport
oOpenDialog:SetFilter({"*.CSV"}, {"My import file type", 1)
oOpenDialog:Show()
SELF:cFileNm := oOpenDialog:FileName
Open the file
SELF:prtImportFile := FOpen(SELF:cFileNm)
IF SELF:prtImportFile = F_ERROR
lResult := FALSE
ELSE
cLine := FReadLine(SELF:prtImportFile,1000) // Headline
ENDIF
Check the headline (if there is)
Read the fields
cLine := FReadLine(SELF:prtImportFile,1000)
cField1 := ReadLeftFromMyDelimiter(cLine)
cLine := ReadRightFromMyDelimiter(cLine)
cField2 := ReadLeftFromMyDelimiter(cLine)
etc etc
Check the fileds one by one
Loop through the import file until you get an empty line
Close the file
IF FClose(SELF:prtImportFile)
lResult := TRUE
ELSE
// Errormsg
ENDIF
Op 26-3-2021 om 22:37 schreef juan.chava...@gmail.com:
> Hi:
>
> On mi network I run an aplication using AppendDelimited and it works fine.
>
> But when I try to run it on my costumer network the folowing instruction returns false:
>
> ORIGEN:=DbServer{aTmp,DBEXCLUSIVE}
> IF !ORIGEN:AppendDelimited(CSV,separador) // Si no puede importar los archivos desde el archivo de AX avisa y termina.
> WarningBox{,"Actualizar artÃculos desde el sistema AX:","No fue posible importar los datos desde "+CSV}:Show()
> RETURN nil
> ENDIF
> Any help would be appreciated.
> Thanks,
> Juan
>
>
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Does AppendDelimited needs to have installed some specific RDD or DLL file? "juan.chava...@gmail.com" <juan.chavarria.grillo@gmail.com> - 2021-03-26 14:37 -0700
Re: Does AppendDelimited needs to have installed some specific RDD or DLL file? JohnMartens <martens@tennishulp.info> - 2021-03-27 08:22 +0100
Re: Does AppendDelimited needs to have installed some specific RDD or DLL file? Steve <semmett1955@gmail.com> - 2021-03-27 00:50 -0700
Re: Does AppendDelimited needs to have installed some specific RDD or DLL file? Fred Killet <killet@killetsoft.de> - 2021-04-03 09:47 +0200
csiph-web