Field x is required, But not supplied.
Posted: 16.02.2010, 20:47
Everythime I want to insert data to my MySQL database I have this erro message. I'm using the ZQuery with the ZUpdateSQL component. I've added all the parameters. But everythime I have this error. Can someone help me with it, I don't know tihs is a stupid question or not, Or it's asked many times.
Here is some of my code.
MySQL query
This is the query i'musing with the updatesql component.
Here is some of my code.
Code: Select all
procedure TForm2.Button2Click(Sender: TObject);
var
while22 : integer;
begin
if opendialog1.Execute then
begin
listbox2.Items.AddStrings(opendialog1.Files);
while22 := 1;
{ while 0 >= listbox2.Items.Count do
form3.BASSPlayer1.Open(listbox2.Items.Strings[while22]);
zquery4.Active := false;
zquery4.Active := true;
zquery4.Append;
zupdatesql1.Params.ParamByName('genre').Value := form3.BASSPlayer1.StreamInfo.Genre;
zupdatesql1.params.ParamByName('artist').Value := form3.BASSPlayer1.StreamInfo.Artist;
zupdatesql1.params.ParamByName('album').Value := form3.BASSPlayer1.StreamInfo.Album;
zupdatesql1.params.ParamByName('title').Value := form3.BASSPlayer1.StreamInfo.Title;
zupdatesql1.params.ParamByName('filename').Value := form3.BASSPlayer1.StreamPath;
zquery4.Post;
zquery4.ApplyUpdates;
zquery4.CommitUpdates;
inc(while22);
end;
end; }
//myQuery.Prepare;
try
for while22 := 0 to listbox2.Items.Count do
begin
//myString := IntToStr(i);
// myQuery.ParamByName('AString').AsString := myString;
// myQuery.ExecSQL;
form3.BASSPlayer1.Open(listbox2.Items.Strings[while22]);
//zquery4.Active := false;
//zquery4.Active := true;
zquery4.Append;
{ zupdatesql1.Params.ParamByName('genre').Value := form3.BASSPlayer1.StreamInfo.Genre;
zupdatesql1.params.ParamByName('artist').Value := form3.BASSPlayer1.StreamInfo.Artist;
zupdatesql1.params.ParamByName('album').Value := form3.BASSPlayer1.StreamInfo.Album;
zupdatesql1.params.ParamByName('title').Value := form3.BASSPlayer1.StreamInfo.Title;
zupdatesql1.params.ParamByName('filename').Value := form3.BASSPlayer1.StreamPath; }
zupdatesql1.Params.FindParam('genre').Value := 'test';
//zupdatesql1.params.ParamByName('artist').Value := 'test';
//zupdatesql1.params.ParamByName('album').Value := 'test';
//zupdatesql1.params.ParamByName('title').Value := 'test';
//zupdatesql1.params.ParamByName('filename').Value := 'test';
zquery4.Post;
zquery4.ApplyUpdates;
zquery4.CommitUpdates;
// inc(while22);
end;
finally
// myQuery.UnPrepare;
while22 := 0;
end;
end;
end;
end.
Code: Select all
INSERT INTO songs2(title, artist, album, genre, filename)VALUES(:title, :artist, :album, :genre, :filename);