Jessy_ZA

No Rank
Points: 0
So i have a project for school but im getting this SQL Syntax error and i just cant seem to fix it
First chance exception at $76C23F12. Exception class EOleException with message 'Syntax error in INSERT INTO statement'. Process MainForm_P.exe (8848)
procedure TForm1.Button1Click(Sender: TObject);
var
Username, Password : string;
begin
Username := edtUsername.Text;
Password := edtPassword.Text;
with ADOQuery1 do begin
SQL.Clear;
SQL.Add ('INSERT INTO Accounts(Username,Password)');
SQL.Add('VALUES (:Username, :Password)');
Parameters.ParamByName('Username').Value := edtUsername.text;
Parameters.ParamByName('Password').Value := edtPassword.text;
ADOQuery1.ExecSQL;
end;
if ADOQuery1.RecordCount = 0 then
Application.MessageBox('Wrong Username', 'Error',
MB_OK or MB_ICONINFORMATION)
else
begin
if ADOQuery1.FieldByName('password').AsString <> edtPassword.Text
then Application.MessageBox('Be sure username and password is correct',
'Error', MB_OK or MB_ICONERROR)
else
begin
Form1.Hide;
Form2.Show;
end;
end;
end;
Read More...
Basic Information
-
Gender
Female -
Birth Date
2000-07-19 -
About me
Im a IT student here to receive and provide help where i can
Contact Information
-
Country
South Africa
Education
-
College / University
Afrikaans High School Sasolburg -
Graduation Year
2018