Page 1 of 1

Help please, it does not work on xbase

Posted: Tue Mar 28, 2017 6:19 pm
by Jose Marte
Please, I need your help, whoever you may be interested in, I have this small code in foxpro to fill a database with from a txt file. What happens to me is that in xbase, I only fill the first field, the other fields do not recognize them, if someone please could tell me or help solve this, thank you.

Close All
Set Safety oFF

Select 0
Use Ponches Exclusive
Zap
Append From C:\PONCHES\Ponches.Txt Type Delimited
Close All

Set Safety On

Quit

Re: Help please, it does not work on xbase

Posted: Tue Mar 28, 2017 10:10 pm
by TWolfe
Assuming the .txt file is comma delimited, try:
Append From "C:\PONCHES\Ponches.Txt" DELIMITED

IF the .txt file is fixed length fields, try:
Append From "C:\PONCHES\Ponches.Txt" SDF

The commands "Set Safety oFF" and "Set Safety oN" are not needed

HTH,
Terry

Re: Help please, it does not work on xbase

Posted: Tue Mar 28, 2017 10:51 pm
by Auge_Ohr
Jose Marte wrote:Append From C:\PONCHES\Ponches.Txt Type Delimited
not sure what FoxPro have default sign for Delimited so look into your *.TXT

guess it is ";" so try

Code: Select all

Append From C:\PONCHES\Ponches.Txt DELIMITED WITH ";"

Re: Help please, it does not work on xbase

Posted: Tue Mar 28, 2017 11:19 pm
by Victorio
Hi, when I converted my Clipper programs to Xbase, I had problem with append like this :
append from &infuvi DELIMITED with ";"

Now I use this :
SELECT 1
use &fpdbf
nHandle:=DC_TxtOpen(infuvi)
do while !DC_TxtEof(nHandle)
cLine:=DC_TxtLine(nHandle)
IF 1->(DC_AddRec(5))
if len(cLine)>254
replace riadok with substr(cLine,1,254)
replace riadok_ with substr(cLine,255,254)
else
replace riadok with cLine
endif
1->(dbRUnlock())
ENDIF
DC_TxtSkip(nHandle,1)
enddo
* zatvorenie text.súboru
DC_TxtClose(nHandle)

In this example I controlling length of line to 254 characters, but this can disable

Re: Help please, it does not work on xbase

Posted: Thu Mar 30, 2017 1:32 pm
by Eugene Lutsenko
Jose Marte wrote:Please, I need your help, whoever you may be interested in, I have this small code in foxpro to fill a database with from a txt file. What happens to me is that in xbase, I only fill the first field, the other fields do not recognize them, if someone please could tell me or help solve this, thank you.

Close All
Set Safety oFF

Select 0
Use Ponches Exclusive
Zap
Append From C:\PONCHES\Ponches.Txt Type Delimited
Close All

Set Safety On

Quit
Here is a system that you develop and improve:
http://lc.kubagro.ru/aidos/_Aidos-X.htm
Everything is there: the executable modules, source code, and databases. You might need it for something.

The system has a hierarchical menu screens, use graphics, work with texts, databases, and directly with the files on the signs, work with Internet through http and ftp protocols.

Re: Help please, it does not work on xbase

Posted: Mon Apr 17, 2017 10:08 am
by Jose Marte
Thanks, thank you very much for all your comments and valuable help, thanks for taking a little of your busy time to answer, I hope to continue counting on your help, since I am starting in the migration to xbase, thank you. :D :handgestures-thumbup: