Subject | Configure Queries at run_time |
---|---|
Author | wayne |
Post date | 2002-11-12T15:00:36Z |
I used a form then set all the properties of the Controls ..
and tested them .. all seemed fine.
Then I viewed The entire form as "Text",
and copeid the Creattion of the controls to my new Unit , that is not
a decendant of TForm.
Now I get some Error SQL "-104"
"Unexpected end of command" : WHEN I OPEN the DATASET
here is a snippet of the code ~
constructor TExpireU.Create(AOwner: TComponent);
begin
inherited;
qryAcc := TIB_Query.Create(self);
qryDetail := TIB_Query.Create(self);
qryExpire := TIB_Query.Create(self);
trExpireClients := TIB_Transaction.Create(self);
IB_DataSource1 := TIB_DataSource.Create(self);
setOther;
setQryAcc;
setQryDetail;
setQryExpire;
end;
procedure TExpireU.setOther;
begin
// Transaction
with trExpireClients do
begin
IB_Connection := DataModule1.IB_Connection1;
Isolation := tiConcurrency;
end;
// DataSource
with IB_DataSource1 do
begin
Dataset := qryAcc;
end
end;
procedure TExpireU.setQryAcc;
begin
with qryAcc do
begin
IB_Connection := DataModule1.IB_Connection1;
IB_Transaction := trExpireClients;
SQL.Text := (
'SELECT ID' +
' , BUSINESS_NAME' +
' , EXPIRE_DATE' +
' , EXPIRE_PROCESSED' +
' , INITIAL_TAKE_ON' +
'FROM CLIENT_ACCOUNT');
DeleteSQL.Text := (
'DELETE FROM CLIENT_ACCOUNT' +
'WHERE' +
' ID = :OLD_ID');
EditSQL.Text := (
'UPDATE CLIENT_ACCOUNT SET' +
' ID = :ID, /*PK*/' +
' BUSINESS_NAME = :BUSINESS_NAME,' +
' EXPIRE_DATE = :EXPIRE_DATE,' +
' EXPIRE_PROCESSED = :EXPIRE_PROCESSED,' +
' INITIAL_TAKE_ON = :INITIAL_TAKE_ON' +
'WHERE' +
' ID = :OLD_ID');
InsertSQL.Text := (
'INSERT INTO CLIENT_ACCOUNT(' +
' ID, /*PK*/' +
' BUSINESS_NAME,' +
' EXPIRE_DATE,' +
' EXPIRE_PROCESSED,' +
' INITIAL_TAKE_ON)' +
'VALUES (' +
' :ID,' +
' :BUSINESS_NAME,' +
' :EXPIRE_DATE,' +
' :EXPIRE_PROCESSED,' +
' :INITIAL_TAKE_ON)');
KeyLinks.Text := (
'CLIENT_ACCOUNT.ID');
end;
end;
and tested them .. all seemed fine.
Then I viewed The entire form as "Text",
and copeid the Creattion of the controls to my new Unit , that is not
a decendant of TForm.
Now I get some Error SQL "-104"
"Unexpected end of command" : WHEN I OPEN the DATASET
here is a snippet of the code ~
constructor TExpireU.Create(AOwner: TComponent);
begin
inherited;
qryAcc := TIB_Query.Create(self);
qryDetail := TIB_Query.Create(self);
qryExpire := TIB_Query.Create(self);
trExpireClients := TIB_Transaction.Create(self);
IB_DataSource1 := TIB_DataSource.Create(self);
setOther;
setQryAcc;
setQryDetail;
setQryExpire;
end;
procedure TExpireU.setOther;
begin
// Transaction
with trExpireClients do
begin
IB_Connection := DataModule1.IB_Connection1;
Isolation := tiConcurrency;
end;
// DataSource
with IB_DataSource1 do
begin
Dataset := qryAcc;
end
end;
procedure TExpireU.setQryAcc;
begin
with qryAcc do
begin
IB_Connection := DataModule1.IB_Connection1;
IB_Transaction := trExpireClients;
SQL.Text := (
'SELECT ID' +
' , BUSINESS_NAME' +
' , EXPIRE_DATE' +
' , EXPIRE_PROCESSED' +
' , INITIAL_TAKE_ON' +
'FROM CLIENT_ACCOUNT');
DeleteSQL.Text := (
'DELETE FROM CLIENT_ACCOUNT' +
'WHERE' +
' ID = :OLD_ID');
EditSQL.Text := (
'UPDATE CLIENT_ACCOUNT SET' +
' ID = :ID, /*PK*/' +
' BUSINESS_NAME = :BUSINESS_NAME,' +
' EXPIRE_DATE = :EXPIRE_DATE,' +
' EXPIRE_PROCESSED = :EXPIRE_PROCESSED,' +
' INITIAL_TAKE_ON = :INITIAL_TAKE_ON' +
'WHERE' +
' ID = :OLD_ID');
InsertSQL.Text := (
'INSERT INTO CLIENT_ACCOUNT(' +
' ID, /*PK*/' +
' BUSINESS_NAME,' +
' EXPIRE_DATE,' +
' EXPIRE_PROCESSED,' +
' INITIAL_TAKE_ON)' +
'VALUES (' +
' :ID,' +
' :BUSINESS_NAME,' +
' :EXPIRE_DATE,' +
' :EXPIRE_PROCESSED,' +
' :INITIAL_TAKE_ON)');
KeyLinks.Text := (
'CLIENT_ACCOUNT.ID');
end;
end;