AllocateColumn := 0;
For Count := 1 to (ADOTable1.FieldCount - 1) do
Begin
If ADOTable1['Student' + IntToStr(Count)] <> 0 Then
Begin
AllocateColumn := AllocateColumn + 1;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('UPDATE Timetable');
ADOQuery1.SQL.Add('SET TimeSlot' + IntToStr(AllocateColumn) + ' = ' + [B]ADOTable1['Student' + IntToStr(Count)])[/B];
ADOQuery1.SQL.Add('WHERE Teacher = ' + SortedNumofAppsPerTeach[Temp, 1] + ';');
ADOQuery1.ExecSQL;
end;
The problem part of the code is in bold. As you can see, I have used exactly the same code for the IF statement above and it works fine.
Any ideas? Google gives me nothing.
If it helps, Count, Temp and AllocateColumn are integers.
Problem has been fixed. Thank you
Edited by Ilikestring, 26 March 2010 - 06:41 AM.


Sign In
Create Account


Back to top









