I am trying to insert some text into a sqlite database.
I am using FireDac connection and FireDac Query(FDQuery1) to connect to the sqLite database. Here is code.
FDQuery1.SQL.Text := 'select * from Invoice where Name = :Name';
FDQuery1.ParamByName('Name').AsString := '123';
FDQuery1.Open;
LinkListControlToField1.BindLink.FillList
I seems there is a new record inserted in the database but all fields are null. What could be the problem ?
Now i am using
NEW_NAME:='dfddf';
SQL :='INSERT INTO INVOICE (Name) VALUES (:NEW_NAME)';
fdquery1.Close;
fdquery1.SQL.Text:= SQL;
FdQuery1.Open();
FDQuery1.Insert;
//Fdquery1.ParamByName('New_Name').AsString := NEW_NAME;
//fdquery1.SQL.Text:='INSERT INTO INVOICE (Name) VALUES (:NEW_NAME)';
fdquery1.FieldByName('Name').AsString := quotedstr(NEW_NAME);
//fdquery1.ExecSQL();
fdquery1.Post;
I am getting eerror message. FireDac, Phys,Sqlite - 308 Can not open/define command, wiich does not return result sets. Hint use Execute? ExecSql metnod for non Select commands.
As you can see from the commented code I am trying the ExecSql but same error.