Home > Back-end >  DataSnap executing SQL statements
DataSnap executing SQL statements

Time:10-05

In the home side server method
DBXCmd:=Frm_Main SQLConnection1. DBXConnection. CreateCommand;
DBXCmd.Com mandType:=TDBXCommandTypes. DSServerMethod;
DBXCmd. Text:='TServerMethods_Main. TreeViewChangeServer';
DBXCmd. Prepare;
DBXCmd. The Parameters [' ov] Value. AsVariant:=ParamsToVariant (p);//parameters into OleVariant
DBXCmd. ExecuteQuery;

Server. This method TServerMethods_Main TreeViewChangeServer performed an SQL statement only
How to appear in "SQL event detector" two of the same SQL statement?


not letter, to see in a method of client calls the server (server method contains a single SQL statement),
To use SQL event detector tracking try to see

CodePudding user response:

 
The function TServerMethods1. ReturnDSP (SQL: string) : OleVariant;
Var
MRC: TADOQuery;
DSP: TDataSetProvider;

M: Olevariant;
The begin

MRC:=TADOQuery. Create (self);
MRC. Connection:=ADOConnection1;
MRC. Close;
MRC. SQL. The Clear;
MRC. SQL. The Add (SQL);
MRC. Open;

DSP:=TDataSetProvider. Create (self);
DSP. The DataSet:=MRC;

Result:=DSP. The Data;

FreeAndNil (DSP);
FreeAndNil (MRC);

end;

Please perform this server functions in SQL event detector will track two SQL statements,
According to the truth about each performs a function, only a single SQL statement is executed,
Why ah?

CodePudding user response:

Without the Result:=DSP. The Data; There will be no two

CodePudding user response:

MRC. Open it don't need,

In the implementation Result:=DSP. The Data that automatically MRC. Open,

CodePudding user response:

In the implementation Result:=DSP. The Data that automatically MRC. Open

Can close the Open automatically?
  • Related