Board index » delphi » dbase data convert to text file

dbase data convert to text file

Hello,

I have made a simple Delphi program that uses dBase tables to produce
labels. Now my customer wants the data on a floppy disk for usage in a ink
jet system which print directly on the items. They can use data in a text
file. How can Delphi convert data from dBase tables to a textfile on a
floppy disc? (I've got a week to solve this)

Thanks in advance

--
Regards
Kai Inge

{When I realized the difference between estimated time used and real time
used - I realized that the life is going to be too short.}

 

Re:dbase data convert to text file


Kai Inge,
Look up these procedures in the Help:
        Rewrite (creates and opens a file)
        AssignFile (link a file var to a disk file)
        Reset (opens an existing file)
        Append (adds a string to the end of an open file)

In your program, generate a dataset with all the records you want to
send to the file. Loop through the dataset building a string with the
data from each field, adding the necessary separator codes. Use Write
or Writeln or Append to write the string to the file. FileClose when
done. The help has lots of example code to show how to do this.

hth,
Dan

On Wed, 13 Jan 1999 22:27:49 +0100, "Kai Inge Buseth"

Quote
<kibus...@online.no> wrote:
>Hello,

>I have made a simple Delphi program that uses dBase tables to produce
>labels. Now my customer wants the data on a floppy disk for usage in a ink
>jet system which print directly on the items. They can use data in a text
>file. How can Delphi convert data from dBase tables to a textfile on a
>floppy disc? (I've got a week to solve this)

>Thanks in advance

>--
>Regards
>Kai Inge

>{When I realized the difference between estimated time used and real time
>used - I realized that the life is going to be too short.}

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control: Consulting, Software,
and the only comprehesive textbook on this subject.
visit us at www.cmdcsystems.com
[Remove the SPAM from my e-mail address]

Re:dbase data convert to text file


Quote
Dan Brennand wrote:

> Kai Inge,
> Look up these procedures in the Help:
>         Rewrite (creates and opens a file)
>         AssignFile (link a file var to a disk file)
>         Reset (opens an existing file)
>         Append (adds a string to the end of an open file)

Also look the standard TBatchMove component. BatchMove your ttdBase
table to a Destination table, Destination table having type ttAscii.

Markku Nevalainen

Re:dbase data convert to text file


Thank you all for your attention. I've learned a lot of useful things.

Thanks again.
--
Regards
Kai Inge

Other Threads