Prepared changes to False after ExecSQL

Prepared changes to False after ExecSQL

Postby Peca » Sat 29 Jan 2011 20:42

Hi,
I use dbExpress with dbxida(2.2) with TSQLQuery. When I create prepared query and set it to prepare, after first call ExecSQL my TSQLQuery chages its Prepared status to False.

I tried change CQLConnection param Prepared, but without success.

Can anybody tell me what to do to save Prepared state?

var
QInsert:TSQLQuery;
S: String;
I:Integer;
begin
S := 'insert into PERSONS ('+
' PERSONNUM1'+
', PERSONNUM'+
') values ('+
' :PERSONNUM1' +
', :PERSONNUM'+
')';

if not Assigned(QInsert) then
begin
QInsert:= TSQLQuery.Create(nil);
QInsert.SQLConnection:=con1;
con1.Params.Values['Prepared'] := 'True'; //do nothing

QInsert.SQL.Add(S);
QInsert.Prepared:= True;
end;

for I := -1 downto -3 do
begin
QInsert.ParamByName('PERSONNUM1').AsInteger:= I;
QInsert.ParamByName('PERSONNUM').AsString:= 'xxx'+ InttoStr(I);
QInsert.ExecSQL; // after first execute sets prepare to false
end;




Thanks-
Peca
 
Posts: 4
Joined: Sun 30 Sep 2007 21:56

Postby AndreyZ » Tue 01 Feb 2011 10:52

Hello,

I cannot reproduce the problem. Please try composing a small sample to demonstrate the problem and send it to andreyz*devart*com.
AndreyZ
 

Postby AndreyZ » Thu 10 Feb 2011 12:19

I have answered you by e-mail.
AndreyZ
 


Return to dbExpress driver for InterBase & Firebird