Dears
I wrote a simple program with Tquery component (from builtin component on D7) conected to interbase database as below
SELECT CHD_CODE, CHD_NAME, CHD_FAMILY, CHD_STATUS, GRP_CODE
FROM CHILDS_T Childs_t
Where (1=1)
And (CHD_FAMILY Like "%'+Edit1.Text+'%")
And (CHD_STATUS=1)
Order by CHD_CODE
It works fine on IB database, But shows error on when I use Unidac TUniQueryat line
CHD_FAMILY Like "%'+Edit1.Text+'%"
what is my error?so what is your suggest?
Query Vs UniQuery
Re: Query Vs UniQuery
To make your sample work correctly, you should replace the " character with '. For example:
Code: Select all
UQuery.Sql.Text := 'SELECT CHD_CODE, CHD_NAME, CHD_FAMILY, CHD_STATUS, GRP_CODE ' +
'FROM CHILDS_T Childs_t ' +
'Where (1=1) ' +
'And (CHD_FAMILY Like ''%'+Edit1.Text+'%'') ' +
'And (CHD_STATUS=1) ' +
'Order by CHD_CODE';
Re: Query Vs UniQuery
Thanks
But I want to fill query.sql property at runtime.
Does your suggest will work in runtime?
But I want to fill query.sql property at runtime.
Does your suggest will work in runtime?
Re: Query Vs UniQuery
Yes, our code will work in runtime.
Re: Query Vs UniQuery
thanks I will try so then inform you.
regards
regards