" sign lazarus / 16-Databases ---------------------------------------------------------------------- asdf · 2010-11-15 10:26 Using Firebird, field1 varchar(100), No1 : integer; No2 : string; readline(textfile1,ln); SQLQuery.Sql.Text:='update table1 set field1 =' + quotedstr(ansitoutf8(ln)) + 'where id = ' + recID + ')';    Now SQLQuery.Sql.Text has error. In VB6 it has ( " ) sign, but overhere we have only ( ' ) - I'm very confused. Please help rearranging SQLQuery.Sql.Text. Thank you in advance ---------------------------------------------------------------------- asdf · 2010-11-15 10:30 Sorry RecID: String; ---------------------------------------------------------------------- JohnvdWaeter · 2010-11-15 10:51 more important: what does the error say? ---------------------------------------------------------------------- ivan17 · 2010-11-15 11:38 function quotedstr is hardcoded to use single-quote. luckily for you, AnsiQuotedStr is not. ---------------------------------------------------------------------- JohnvdWaeter · 2010-11-15 11:43 or maybe: SQLQuery.Sql.Text:='update table1 set field1 =' + quotedstr(ansitoutf8(ln)) + 'where id = ' + recID + ')';    Put a space just before where: ... + ' where id = ' + recID + ')';    John ---------------------------------------------------------------------- asdf · 2010-11-15 15:11 The error is as attached photo.... ---------------------------------------------------------------------- JohnvdWaeter · 2010-11-15 15:17 just as it says: there is a closing bracket ) that should not be there. ---------------------------------------------------------------------- SteveF · 2010-11-15 15:30 PMFJI, but Firebird also uses the double-quotes to delimit its table and column names.  The following is a valid Firebird SQL statement: SELECT * FROM "ORDERS" WHERE "ORDERS"."CUSTNAME" = 'WIDGETS INC'; If you need them in this way, you can always include them in your SQL string by using #34 in the string build to supply the ASCII character. Steve ---------------------------------------------------------------------- asdf · 2010-11-15 15:35 Thank you so much. In the past with VB6, I always check by MessageBox? I tried the same overhere, the result is clear. There was an unimportant '('. Please use this technique. ---------------------------------------------------------------------- asdf · 2010-11-15 15:41 One more please. Why RecID did not need quotedstr? But on the other hand, at quotedstr(ansitoutf8(ln)) - It is a 'must'. ---------------------------------------------------------------------- SteveF · 2010-11-15 16:06 Quote from: asdf on November 15, 2010, 04:41:00 pmOne more please. Why RecID did not need quotedstr? But on the other hand, at quotedstr(ansitoutf8(ln)) - It is a 'must'. Most likely because RecID is numeric, no delimiter needed.  If Field1 is defined as char() or varchar() then the ' delimiters around the value for the column are required to build a valid SQL string. If you haven't already, you need to take a look at the documentation on the Firebird website for the specific SQL syntax Firebird requires. Steve