Binding variables at runtime
Posted: Fri 05 Oct 2007 09:45
Hi all,
Being new to using this technique of connecting to a Firebird database with IBDAC I've stumbled quite early on.
I have a form with a DBGrid and is set up to access my database - which it does quite well and I can look at all of the table contents including some views that I've constructed.
How ever when I try to do a insert using the following:I get a line inserted with an ID auto generated within Firebird but either no values or the values from the first line in the grid.
When I inspect the SQL text it does not appear to have inserted the values from the fields that I have enetered, I've named the fields to be the same as the database columns i.e.DATALOG_DATE, DATALOG_DESCRIPTION, DATALOG_VALUE.
Help - how do I bind the variable values into the sql statement at runtime?
Thanks for any pointers as I like to do things the hard way
Being new to using this technique of connecting to a Firebird database with IBDAC I've stumbled quite early on.
I have a form with a DBGrid and is set up to access my database - which it does quite well and I can look at all of the table contents including some views that I've constructed.
How ever when I try to do a insert using the following:
Code: Select all
RARsQuery.DMLRefresh:=true;
RARsQuery.SQL.Text := 'INSERT INTO DATALOG("DATALOG_DATE", "DATALOG_DESCRIPTION", "DATALOG_VALUE")
VALUES (:"DATALOG_DATE", :"DATALOG_DESCRIPTION", :"DATALOG_VALUE")';
RARsQuery.ExecSQL;
When I inspect the SQL text it does not appear to have inserted the values from the fields that I have enetered, I've named the fields to be the same as the database columns i.e.DATALOG_DATE, DATALOG_DESCRIPTION, DATALOG_VALUE.
Help - how do I bind the variable values into the sql statement at runtime?
Thanks for any pointers as I like to do things the hard way
