Hi,
I am looking to do the following below with corelab products...
Below is how I do it with TADO.
Query1.Parameters.CreateParameter('clientid', ftstring, pdInput,5,0);
Query1.Parameters.AddParameter;
with sql do
begin
Clear;
add('SELECT strClientId');
add('FROM [2001 Companies]');
add('Where clientid= :strClientId');
end;
Query.Parameters.ParamByName('clientid').Value := EDClientId.Text;
Add params programatically
With MyDAC you can do it easier:
So you needn't create parameters manually.
Code: Select all
with Query.sql do
begin
Clear;
add('SELECT strClientId');
add('FROM [2001 Companies]');
add('Where clientid= :strClientId');
end;
Query.Params.ParamByName('clientid').AsString := EDClientId.Text;
I make a small correction, it should be strClientId as the parameter:
Code: Select all
Query.Params.ParamByName('strClientId').AsString := EDClientId.Text;