Page 1 of 1

Help Query

Posted: Sat 19 Nov 2011 16:12
by kykyiiikuh
Hello.
use
Programming environment: Delphi 7
Version MyDac: 5.90.0.57

Compose a query ('UPDATE `public1` SET `access` = 2 WHERE `id` = 86')
The program compiles no errors, but when to press the Button, this error is displayed. But the editing is performed
Image

the code used

Code: Select all

MyQuery1.SQL.Clear;
MyQuery1.SQL.Add('UPDATE `public1` SET `access`=2 WHERE `id`=86');
MyQuery1.Active:=true;
Please help.
sought to find a similar theme, not really what is not found, have found one example http://www.devart.com/forums/viewtopic. ... ht=myquery [3 posts]

but the problem is not found...

Posted: Mon 21 Nov 2011 12:11
by AndreyZ
Hello,

The point is that the UPDATE statement doesn't return any result set. To solve the problem, you should use the Execute method in the following way:

Code: Select all

MyQuery1.SQL.Clear; 
MyQuery1.SQL.Add('UPDATE `public1` SET `access`=2 WHERE `id`=86'); 
MyQuery1.Execute;

Posted: Mon 21 Nov 2011 12:28
by kykyiiikuh
Thanks for your reply.