No File is Being Created when Using TIBOutputRawFile in Delp |
|
I have the following procedure:
procedure TForm1.Button1Click(Sender: TObject);
var
RawOutput: TIBOutputRawFile;
FileName: string;
begin
RawOutput:= TIBOutputRawFile.Create;
try
with IBSQL1 do begin
close;
sql.text:= 'select * from employee';
RawOutput.FileName := 'TRANS.ibx';
BatchOutput(RawOutput);
end;
finally
RawOutput.Free
end;
end;
In Delphi XE6, even though this procedure is run without any exceptions, no file is being created. It created the file just fine with Delphi XE5 and before.
Has anything changed? Am I missing something?
|
Re: No File is Being Created when Using TIBOutputRawFile in |
|
> {quote:title=Jeff Overcash (TeamB) wrote:}{quote}
> Mike Norayr Monjian wrote:
> > I have the following procedure:
> >
> > procedure TForm1.Button1Click(Sender: TObject);
> > var
> > RawOutput: TIBOutputRawFile;
> > FileName: string;
> > begin
> > RawOutput:= TIBOutputRawFile.Create;
> > try
> > with IBSQL1 do begin
> > close;
> > sql.text:= 'select * from employee';
> > RawOutput.FileName := 'TRANS.ibx';
> > BatchOutput(RawOutput);
> > end;
> > finally
> > RawOutput.Free
> > end;
> > end;
> >
> > In Delphi XE6, even though this procedure is run without any exceptions, no file is being created. It created the file just fine with Delphi XE5 and before.
> >
> > Has anything changed? Am I missing something?
>
> Yes in finally fixing outputting Unicode character in the delimited file version
> I messed up RAW file slightly.
>
> In both TIBOutputRawFile and TIBInputRawFile add a public procedure
>
> {code}
> procedure ReadyFile; override;
> {code}
>
> Then the two new procedures look like
>
> {code}
> procedure TIBOutputRawFile.ReadyFile;
> begin
> inherited;
> FFile := TFileStream.Create(FFilename, fmCreate or fmShareDenyWrite);
> end;
>
> ...
>
> procedure TIBInputRawFile.ReadyFile;
> begin
> inherited;
> FFile := TFileStream.Create(FFilename, fmOpenRead or fmShareDenyWrite);
> end;
>
> {code}
>
> This will have to be delayed till XE7 to actually get into an official update
> since it requires breaking the interface.
>
> Sorry about that, the Unicode part needed a pretty big rewrite on the Delimited
> side of the inheritance tree.
>
> --
> Jeff Overcash (TeamB)
> (Please do not email me directly unless asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpeted corridors of Whitehall.
> (Fish)
Thanx, Jeff.
I did the changes. The raw file export & import works fine. As for the delimited file, the export works fine (at least looks fine) but the import results in an "EConvertError with message 'X' is not a valid date and time" exception. FYI, my date format in the regional settings is 'dd/mm/yyyy' and the date fields in the export file look fine. I don't know if the import is trying to read them in Interbase format, i.e. 'mm/dd/yyyy'.
BTW, do I add "$(BDS)\Source\IBX" to the library path or just copy the new IBX.IBSQL.dcu file created to the "$(BDSLIB)\$(Platform)\release" folder?
|