The Votes
column defualt value is 0. Every time when I click the button it must add whichever value I want to the specific row I want.
My error is :
Syntax error : Update statement. [[Delphi]]
This is my code :
procedure TForm4.BitBtn1Click(Sender: TObject);
var
spinval : integer;
begin
spinval := SpinEdit1.value;``
// Candidatetable.Insert;
// Candidatetable['Votes'] := Candidatetable['Votes'] + spinval;
ADOQuery1.Active := false;
ADOQuery1.SQL.Text := 'Update Candidate_table set votes = ''' +
Candidatetable['Votes'] + IntToStr(spinval) +
''' where Name = ''' + DBLookupComboBox1.Text + '''';
ADOQuery1.ExecSQL;
ADOQuery1.Active := false;
ADOQuery1.SQL.Text := 'Select * from Candidate_table';
ADOQuery1.Active := true;
MessageDlgPos('Thank you for voting. You will be logged out.' , mtInformation, [mbOK], 0, 1000, 500);
Form4.Hide;
Form2.Show;
end;
PlEASE HELP =)
Thanks.