Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create ASCII DOS Text files w/ paradox 5 Tables (*.DB) 2

Status
Not open for further replies.

bcny33

Technical User
Apr 24, 2001
33
US
Hello,

Looking for some help in converting a huge amount of paradox 4.5 & paradox 5.0 tables to ASCII DOS TEXT Delimited Files. Is there any easy way to convert(EXPORT) lots paradox tables to ASCII DOS TEXT. The only way I can see how to do it is through the utilities/export function. But it will only let you export one table at a time. I want to export a lot of tables at the same time.

You are probably asking why? Well just need an easy way to print all of the info in some 400 paradox tables. I do not want to create 400 quick reports etc...

Thanks you very much for any help!!!...

byny33
 
Try this:

Var
FS FileSystem
sDataPath String
sFileList String
arFileName Array[] String
tc TCursor
lError Logical
EndVar

sDataPath = "C:\\myData\\" ; put the data path here. Make sure you end with \ sTargetPath = "C:\\TextData\\" ; where you want to put the exported text file
sFileList = ":pRIV:Answer.db"
FS.eNumFileList(sDataPath+"*.DB",sFileList)
tc.Open(sFileList)
Scan tc:
sFileName = tc."name"
Message("Exporting "+StrVal(tc.RecNo())+" of "+StrVal(NRecords(sFileList))+" - "+sFilename)
sFileName.BreakApart(arFileName,".")
sOutputName = arFileName[1]
lError = False
Try
ExportASCIIVar(sFileName,sTargetPath+sOutputName+".TXT")
OnFail
lError = True
EndTry
If lError Then
MsgInfo("Error","Cannot export "+sFileName)
EndIf
EndScan
tc.Close()

 
Great one for those of us lower on the knowledge scale. Thank you.
 
bcny33,

In addition to exporting those reports, you may be interested in which shows one way to use a template report to quickly create instant reports for your tables.

Combine that with some of JoeNg's code (or even some from which shows a way to recursively search through a set of directories) and you might even be able to use Paradox itself to print your table data.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top