Board index » cppbuilder » How to use an ASCII text file as data base

How to use an ASCII text file as data base


2004-06-09 10:21:45 PM
cppbuilder3
In a simple BCB6 application I want to access an ASCII text file as my
table.
There is a TextDataSet component in BCB6' examples but I could not make it
work.
Can some one tell me how can I use an ASCII text file as my table
(hopefully without the need for BDE) ?
 
 

Re:How to use an ASCII text file as data base

A bit more specific, I want to access multiple columns table as show below;
X Y Z A B T
123.2 456 789 abc def 098
222.3 333 444 AAA BBB 666
Quote
In a simple BCB6 application I want to access an ASCII text file as my
table.
There is a TextDataSet component in BCB6' examples but I could not make it
work.

Can some one tell me how can I use an ASCII text file as my table
(hopefully without the need for BDE) ?
 

Re:How to use an ASCII text file as data base

Hello Tomas,
I've never used ASCII tables before. Have a look at TTable::TableType in the help file. I've just created a text file using the TTable component. I've got a "corrupt file" error message after I put some data into the file using Notepad.exe, it seems that the "carriage return" and "line feed" control characters are not allowed in the text data file.
Why don't you try this way and create a text data file using a TTable component and edit it using Database components like TTable, TDataSource TDBGrid and others ? I think it will work out .
HTH
Jayme.
<Tomas>wrote in message news: XXXX@XXXXX.COM ...
Quote
A bit more specific, I want to access multiple columns table as show below;

X Y Z A B T
123.2 456 789 abc def 098
222.3 333 444 AAA BBB 666


>In a simple BCB6 application I want to access an ASCII text file as my
>table.
>There is a TextDataSet component in BCB6' examples but I could not make it
>work.
>
>Can some one tell me how can I use an ASCII text file as my table
>(hopefully without the need for BDE) ?


 

{smallsort}

Re:How to use an ASCII text file as data base

Hello Tomas,
I did it as I'd suggested you and it works fine. Make sure nobody can modify the text file without using an application other than the ones you built, otherwise you might have your datafile corrupted.
You only need a TTable, a TDataSource and a TDBNavigator, hide the refresh and delete buttons - they don't work out. You should find a way of delete records from de text data file. I don't know how to do it, it seems that the TDataSet::Delete() method doesn't work out with ASCII tables. The Refresh method could be replaced by Close() and Open() .
HTH
Jayme.
<Tomas>wrote in message news: XXXX@XXXXX.COM ...
Quote
A bit more specific, I want to access multiple columns table as show below;

X Y Z A B T
123.2 456 789 abc def 098
222.3 333 444 AAA BBB 666


>In a simple BCB6 application I want to access an ASCII text file as my
>table.
>There is a TextDataSet component in BCB6' examples but I could not make it
>work.
>
>Can some one tell me how can I use an ASCII text file as my table
>(hopefully without the need for BDE) ?


 

Re:How to use an ASCII text file as data base

Oops,
I'm afraid I forgot that TTable depends on BDE ! Is that right ?
Jayme.
"Jayme Jeffman Filho" < XXXX@XXXXX.COM >wrote in message news:40c764d1$ XXXX@XXXXX.COM ...
Hello Tomas,
I did it as I'd suggested you and it works fine. Make sure nobody can modify the text file without using an application other than the ones you built, otherwise you might have your datafile corrupted.
You only need a TTable, a TDataSource and a TDBNavigator, hide the refresh and delete buttons - they don't work out. You should find a way of delete records from de text data file. I don't know how to do it, it seems that the TDataSet::Delete() method doesn't work out with ASCII tables. The Refresh method could be replaced by Close() and Open() .
HTH
Jayme.
<Tomas>wrote in message news: XXXX@XXXXX.COM ...
Quote
A bit more specific, I want to access multiple columns table as show below;

X Y Z A B T
123.2 456 789 abc def 098
222.3 333 444 AAA BBB 666


>In a simple BCB6 application I want to access an ASCII text file as my
>table.
>There is a TextDataSet component in BCB6' examples but I could not make it
>work.
>
>Can some one tell me how can I use an ASCII text file as my table
>(hopefully without the need for BDE) ?