Help Query

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kykyiiikuh
Posts: 3
Joined: Sat 12 Nov 2011 17:26
Contact:

Help Query

Post by kykyiiikuh » Sat 19 Nov 2011 16:12

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...

AndreyZ

Post by AndreyZ » Mon 21 Nov 2011 12:11

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;

kykyiiikuh
Posts: 3
Joined: Sat 12 Nov 2011 17:26
Contact:

Post by kykyiiikuh » Mon 21 Nov 2011 12:28

Thanks for your reply.

Post Reply