[DUG] firebird query parameters behaving oddly

Steve Peacocke steve.peacocke at gmail.com
Sat Jul 7 20:10:39 NZST 2007


> > the biggest reasons to always use ParamByName instead of building SQL
> > strings IMO.

I note this statement has been presented a few times in this
discussion. I will say that building SQL strings and using ParamByName
are not mutually exclusive.

  With TIBQuery.Create(Nil) do
  Try
        TIBDatabase := MyIBDatabase;
        SQL.Add('SELECT * from MyTable');
        SQL.Add('WHERE MyTable.thisDate = :dToday)');
        ParamByName('dToday').AsDate := dMyDate;
        ...
  Finally
        Free;
  end;


Steve
-- 
Steve Peacocke
http://stevepeacocke.blogspot.com/


More information about the Delphi mailing list