#51 2012-03-10 23:08:09

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Re: Problem with UPDATE query and EngineExecute

OK. But I use my code (with batch) inside a service on my server. So it is not good, right?

In this case, what is the solution? I need of code to allow UPDATE database for all user (simple user and admin) both on client and server (also standalone application).
You said, I must create a service. I just do it but what code I need inside the service? If I cannot use batch, what is the alternative?

If I use Database.Update(Records) inside service (and not BatchUpdate(Records)) all fields not mapped (with CreateAndFillPrepare) are delete after the update. So I cannot understand the solution with service but without BatchUpdate. What is the right code for my service?

Offline

#52 2012-03-11 08:26:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Problem with UPDATE query and EngineExecute

Inside the service, you are on the TSQLRestServer side.

So you can use the Execute*() methods directly from your service code, and the most efficient is to use plain UPDATE SQL statement here, or EngineUpdateField() for one field modification, which will work even without true local SQL engine.

Offline

#53 2012-03-11 11:27:52

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Re: Problem with UPDATE query and EngineExecute

Ok but can I use Execute* on service and call the service by my client (simple user not admin)? In the past I just do it but Execute* return False if I call the Service by client ( not admin).
I will try int again.

Offline

#54 2012-03-11 19:15:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Problem with UPDATE query and EngineExecute

Calling EngineExecute() from the Client side is submitted to the user rights.

Calling EngineExecute() inside a service implementation will make the call on the Server side, so you are not restricted by any user right.
The user right is able services to be executed, not what the service does by itself.
You can check the user rights to disable some services process, if needed.

Offline

Board footer

Powered by FluxBB