I have a SQL query in a AnsiString (because it is more than 255 chars long). How can I pass that query to ADOQuery.SQL ? I can't really use ADOQuery.SQL.Add as the string is to long. I looked at ADOQuery.SQL.SetText but could not get it to work (as i'm **** with pointers).
sBodyInsert, sMessageBody : AnsiString;
sBodyInsert := 'INSERT INTO BodyText (ID, Size, Body) VALUES (';
sBodyInsert := sBodyInsert + IntToStr(iBodyID) + ', 0, ';
sBodyInsert := sBodyInsert + '''' + sMessageBody + ''')';
with ADOQuery do begin
// Here i need to add the SQL from above (in sBodyInsert )