A am compiling a Delphi Win32 ADO database application in Delphi 2006 which
I originally wrote in Delphi 7. I am having a problem with using the
ADOQuery.SQL.LoadFromFile('FileName') method. Since the ADOQuery.SQL
parameter has been changed to TWideStrings, it seems like the SaveToFile and
LoadFromFile methods do not work correctly. You can no longer load a
standard text file with the LoadFromFile method.
Am I doing something wrong or is this just a new feature?
Thanks,
Greg Dunn
The statement should be:
'SELECT * FROM customers'
But ADOQuery1.SQL.LoadFromFile('TestSQL.txt') yields:
'???'#$2A20'???????sM customers'
The code for the TWideStrings.LoadFromFile is almost identical (except for the
filename type) to the code for TStringList.LoadFromFile. But for some reason
they do not yield the same results.
They both call a LoadFromStream, but the values retrieved from the stream are
quite different.
Looks like a bug to me.
The work-around would be to create a TStringList object to do the loading and
saving.
Procedure LoadSQLText ;
Var sl : TStringList ;
begin
sl := TStringList.Create ;
Try
sl.LoadFromFile('TestSQL.txt');
ADOQuery1.SQL.Text := sl.Text ;
ADOQuery1.Open ;
Finally
sl.Free ;
End;
end;
-Steve-
"Gregory A. Dunn" <gr...@eagleresearchcorp.com> wrote in message
news:440cad43$1...@newsgroups.borland.com...
http://qc.borland.com/qc/wc/qcmain.aspx?d=25811
-Steve-
"Gregory A. Dunn" <gr...@eagleresearchcorp.com> wrote in message
news:440cad43$1...@newsgroups.borland.com...
Thanks for adding the QC report.
Thanks,
Greg Dunn
"Steve Zimmelman" <s...@charter.nospam.net> wrote in message
news:440d8960$1...@newsgroups.borland.com...