eof after select
Posted: Sat 23 Oct 2010 22:55
try
MyQuery1.SQL.Clear;
MyQuery1.SQL.Text := 'SELECT products_id, products_model from products where products_model like "'+ApolloTable1LITM.Value+'"';
//showmessage(MyQuery1.SQL.Text) ;
MyQuery1.Execute;
except
end;
if MyQuery1.Eof then
begin // Neu
MyQuery1.SQL.Text := 'INSERT into products ( '+
'products_model, '+
-------------------------------
Not any value is found - always eof although when I give the select command direct in eg phpmyadmin at least one item is found.
How will be eof involved ?
(earlier I worked with the component of scibit and change now - hard)
Thanks Erich
Sunday 24.10.
I use now my old Components (from scibit) for retrieving the id.
after I try to update a record (Inserting is now ok),
but with update I have same problem. Always get a error and I see the that te sql text is cutted.
MyQuery1.SQL.Text := 'UPDATE products SET ( '+
'products_model = :products_model, '+
....more
'products_orgin = :products_orgin '+
') WHERE :Old_products_id ='+neuID;
MyQuery1.ParamByName('products_model').AsString := x_products_model;
MyQuery1.ParamByName('products_quantity').AsInteger := x_products_quantity;
... more ....
MyQuery1.ParamByName('products_orgin').AsString := x_products_orgin;
try
MyQuery1.Execute;
except
end;
...
are there anywhere examples or tutorials which shows to handle with this parameters (INSERT/UPDATE etc )? (the demo I know - nothing usefull found for coding)
I only need search data, retrieve some data, insert records and update records.
MyQuery1.SQL.Clear;
MyQuery1.SQL.Text := 'SELECT products_id, products_model from products where products_model like "'+ApolloTable1LITM.Value+'"';
//showmessage(MyQuery1.SQL.Text) ;
MyQuery1.Execute;
except
end;
if MyQuery1.Eof then
begin // Neu
MyQuery1.SQL.Text := 'INSERT into products ( '+
'products_model, '+
-------------------------------
Not any value is found - always eof although when I give the select command direct in eg phpmyadmin at least one item is found.
How will be eof involved ?
(earlier I worked with the component of scibit and change now - hard)
Thanks Erich
Sunday 24.10.
I use now my old Components (from scibit) for retrieving the id.
after I try to update a record (Inserting is now ok),
but with update I have same problem. Always get a error and I see the that te sql text is cutted.
MyQuery1.SQL.Text := 'UPDATE products SET ( '+
'products_model = :products_model, '+
....more
'products_orgin = :products_orgin '+
') WHERE :Old_products_id ='+neuID;
MyQuery1.ParamByName('products_model').AsString := x_products_model;
MyQuery1.ParamByName('products_quantity').AsInteger := x_products_quantity;
... more ....
MyQuery1.ParamByName('products_orgin').AsString := x_products_orgin;
try
MyQuery1.Execute;
except
end;
...
are there anywhere examples or tutorials which shows to handle with this parameters (INSERT/UPDATE etc )? (the demo I know - nothing usefull found for coding)
I only need search data, retrieve some data, insert records and update records.