Page 1 of 1

DesignTime and Runtime creata component bugs?

Posted: 18.04.2007, 05:40
by klchin
Hi,

I having a very strange problem.

Why the design time TZQuery's RequestLive was working,
but not with the run-time created component always false?

Example,


Design Time ---> Working if RequestLive set to "TRUE"

ZQuery1->Connection = g_DbConn[g_DbsCap].pConn;
ZQuery1->SQL->Text = "SELECT * FROM cnpProduct";
ZQuery1->Active = true;

Design Time ---> Not working if RequestLive set to "FALSE"

ZQuery1->Connection = g_DbConn[g_DbsCap].pConn;
ZQuery1->SQL->Text = "SELECT * FROM cnpProduct";
ZQuery2->RequestLive = true;
ZQuery1->Active = true;

Run time create - Not working

ZQuery2 = new TZQuery( this );
ZQuery2->Connection = g_DbConn[g_DbsCap].pConn;
ZQuery2->SQL->Text = "SELECT * FROM cnpProduct";
ZQuery2->RequestLive = true;
ZQuery2->Active = true;

The main issue was the dataset in "READ-ONLY" mode,
I cannot do any thing with the DB grid and navigator.

What is my problem?


Regards,
KL Chin

Posted: 18.04.2007, 21:33
by kmr
ZQuery1->Connection = g_DbConn[g_DbsCap].pConn;
ZQuery1->SQL->Text = "SELECT * FROM cnpProduct";
ZQuery2->RequestLive = true;
ZQuery1->Active = true;
Is it just a copy-paste-error that ZQuery2.RequestLive is set to true instead of ZQuery1.RequestLive?

Posted: 19.04.2007, 03:36
by klchin
Hi,

Sorry is my fault during paste the code to the post.

It was ZQuery1->RequestLive := true, not ZQuery2.

I did confrmed again, if default set to "FALSE" at design-time
then set to "TRUE" during run-time will never work.

Regards,
KL Chin