Re:D4SP3 TBatchMove: Txt-File is not a CSV-File
Yes, you have to create/modify schema file. By default BDE creates fixes TXT
file, but if you modify the schema file, it will read/write delimited files
too.
For example, if you create TEST.TXT, it's schema file is TEST.SCH.
Its format is like INI files and can be read/modified with INI files api (or
TInifile class):
[TEST]
FileType=delimited
;default is fixed
CharSet=db852sl0
Delimiter="
Separator=,
Field1=....
So, before BatchMove, you assign fielddefs from source dataset, call
CreateTable, disconnect local database, modify TEST.SCH and then call
BatchMove.
--
Robert
Quote
Caroll Ferkl wrote in message <3b8ccad5_1@dnews>...
>Hi I have a short question: I use a TBatchMove in D4 to store a table in
>different
>types. The tabletyp should be depending from the filentyp *.DBF, *.DB or
>*.TXT. DBase and Paradox are OK, but the ASCII-File isn't a comma separated
>File. The fields are only separated with spaces. No commas, no quotation
>marks. Must I adjust something in the BDE-configuration??
>MfG
>:-|
>procedure TDbFrm.DbMainMenuSaveAsClick(Sender: TObject);
>begin
> if (DbSaveDlg.Execute()) then
> begin
> DbFrmTable.TableName := DbSaveDlg.FileName;
> with DbBatchMove do
> begin
> Source := MainFrm.Datenbank;
> Destination := DbFrmTable;
> Mode := batCopy;
> Execute;
> ShowMessage(IntToStr(MovedCount) + ' Datens?tze kopiert');
> end; //BatchMove
> end //Save
> else
> begin
> end; //Escape
>end;