View Single Post
Old 02-10-2017, 09:40 AM
Norrit Norrit is offline
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,274

Your query doesn't translate the values. But I would always suggest using parameters:
AdoQuery1.SQL.Text := 'Insert into LogInDet
    (Roll_no,Password,Stud_Name,FatherName) Values(:Roll_no,:Password,:Stud_Name,:FatherName)';

AdoQuery1.ParamByName('Roll_no').AsInteger := StrToInt(edtRN.Text); // assuming it's int???
AdoQuery1.ParamByName('Password').AsString := edtPswrd.Text;
AdoQuery1.ParamByName('Stud_Name').AsString := edtSName.Text;
AdoQuery1.ParamByName('FatherName').AsString := edtFname.Text;

But your main problem was that you didn't pass the values of the TEdit's but it's name. And you forgot to quote your values (for string). Therefor, the parameter solution is easier and much more readable.
Reply With Quote