Subject | RE: [IBO] Configure Queries at run_time |
---|---|
Author | wayne |
Post date | 2002-11-13T03:56:32Z |
I must be rather silly in asking that ,
I have found my own error,
1) the SQL statement needs spaces between keywords.
2) why not just use a datamodule if you dont want a Form.
But,
I would like to know how does one set the RELATION-SHIPS
at Runtime ( Master-Detail )
Since coping the SQL from the view as text does not work ~
procedure TExpireU.setQryDetail;
begin
with qryDetail do
begin
DatabaseName := DataModule1.IB_Connection1.DatabaseName;
IB_Connection := DataModule1.IB_Connection1;
IB_Transaction := trExpireClients;
SQL.Text := (
' SELECT ID' +
' , DESCRIPTION' +
' FROM CLIENT_ENQ_DESC' +
' ');
DeleteSQL.Text := (
'DELETE FROM CLIENT_ENQ_DESC' +
'WHERE' +
' ID = :OLD_ID');
EditSQL.Text := (
' UPDATE CLIENT_ENQ_DESC SET' +
' ID = :ID, /*PK*/' +
' DESCRIPTION = :DESCRIPTION' +
' WHERE' +
' ID = :OLD_ID');
InsertSQL.Text := (
' INSERT INTO CLIENT_ENQ_DESC(' +
' ID, /*PK*/' +
' DESCRIPTION)' +
' VALUES (' +
' :ID,' +
' :DESCRIPTION)');
KeyLinks.Text := (
' CLIENT_ENQ_DESC.ID');
MasterSource := IB_DataSource1;
MasterLinks.Text := (
' ID=CLIENT_ACCOUNT.ID');
end;
end;
I have found my own error,
1) the SQL statement needs spaces between keywords.
2) why not just use a datamodule if you dont want a Form.
But,
I would like to know how does one set the RELATION-SHIPS
at Runtime ( Master-Detail )
Since coping the SQL from the view as text does not work ~
procedure TExpireU.setQryDetail;
begin
with qryDetail do
begin
DatabaseName := DataModule1.IB_Connection1.DatabaseName;
IB_Connection := DataModule1.IB_Connection1;
IB_Transaction := trExpireClients;
SQL.Text := (
' SELECT ID' +
' , DESCRIPTION' +
' FROM CLIENT_ENQ_DESC' +
' ');
DeleteSQL.Text := (
'DELETE FROM CLIENT_ENQ_DESC' +
'WHERE' +
' ID = :OLD_ID');
EditSQL.Text := (
' UPDATE CLIENT_ENQ_DESC SET' +
' ID = :ID, /*PK*/' +
' DESCRIPTION = :DESCRIPTION' +
' WHERE' +
' ID = :OLD_ID');
InsertSQL.Text := (
' INSERT INTO CLIENT_ENQ_DESC(' +
' ID, /*PK*/' +
' DESCRIPTION)' +
' VALUES (' +
' :ID,' +
' :DESCRIPTION)');
KeyLinks.Text := (
' CLIENT_ENQ_DESC.ID');
MasterSource := IB_DataSource1;
MasterLinks.Text := (
' ID=CLIENT_ACCOUNT.ID');
end;
end;