Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DBF to Text file
Message
 
To
31/12/2004 02:27:18
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00973493
Message ID:
00973532
Views:
16
>Dear Sir,
>
>I have a table entitled "errors" contained following fields
>
>Date, time,errno,message,lineno
>
>I want to show only last record in text file, c:\error.txt,
>but the data of every field must show in new line for example
>
>31/12/2004
>10:00:00
>1200
>field not found
>3
>
>What should I do?
>Please help
>
>Thanks in advance
#define CRLF CHR(13)+CHR(10)
SELECT Errors
GO BOTTOM
c_str = ""
FOR nFlds = 1 TO FCOUNT()
    c_str = c_str + ALLTRIM(TRANSFORM(EVAL(FIELDS(nFlds)))) + CRLF
NEXT
STRTOFILE(LEFT(c_str, LEN(c_str)-1),"Errors.TXT")
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform