afternoon folks.
im creating an application in Delphi to access and update an access database
what i am trying to do is have a doubleclick event on a grid (grid 1 lets call it) that initiates the code below. it then adds certain details to another grid (grid2?)
it will then go on to save to the database when i actually code it in
The code i have is as follows that is generating the error:
(ive added some ... to try and replicate indenting
var
sql: string;
AcadYear: string;
begin
AcadYear := '2008';
sql := 'INSERT INTO StudentOptionChoices ( StudentID, ModuleCode, ...semester, Academic_Year ) ';
sql := sql + ...DBGStudentsList.datasource.dataset.FieldByName( 'studentID').AsString;
sql := sql + ...DBGAvailableModules.datasource.dataset.FieldByN ame('ModuleCode').AsString;
sql := sql + ...DBGAvailableModules.datasource.dataset.FieldbyN ame('semester').AsString;
sql := sql + quotedstr(AcadYear);
...DMStudentRecord.ADOCMOptionsChoices.CommandText := sql;
...DMStudentRecord.ADOCMOptionsChoices.Execute;
---------------------------
so you understand my naming:
DMStudentRecord is a datamodule.
ADOCMOptionsChoices is a TADOCommand
( StudentID, ModuleCode, semester, Academic_Year ) are the fields in the table im inserting into
________________________
THE ERROR I GET:
Syntax error in INSERT INTO statement
i cant for the life of me work out why its saying this.
Anyway. hope this is enough info for you guys and any help will be much appreciated
cheers