German C. Basisty wrote:

Hi again!

 

Well, I’m still learning…

 

I have now a form with a working TPQConnection, a TSQLTransaction, a TSQLQuery with a  ‘select * from product’ as SQL, a TDatasource, an a TDBGrid, everithing is working fine and every product is shown on the DBGrid as expected. Now I want to add an TEdit to make posible searching products by name, for example, so when the user writes something on the Edit, the SQLQuery1.SQL should become something like ‘select * from product where name = ‘ + Edit1.Text + ’

 

Now my questions:

 

-          How do I write in pascal a “ ‘ “ inside a “ ‘ ”? I mean, in C++ I use “ as string container, but in pascal I should use ‘, so, how do I do it?

Double single-quote marks: 'This is a string constant with ''quote'' in single quotes'.  '''' represents a a single quote as a string constant.

   

-          How can I do an update after I change the SQLQuery1.SQL property? I mean, if at the beginning the DBGrid shows all products, then I change the  SQLQuery1.SQL property, how do I do to make the DBGrid show the new filtered content

As far as I know, if you change the SQL you have close the query and reopen it.  This process re-parses it, prepares it, etc.

 

Best regards,

 

German

cheers,
John Sunderland
_________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to