找传奇、传世资源到传世资源站!

DataSnap_Server

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

unit ServerMethodsUnit1;interfaceuses System.SysUtils, System.Classes, System.Json, Datasnap.DSServer, Datasnap.DSAuth, DataSnap.DSProviderDataModuleAdapter, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.MSSQL, FireDAC.Phys.MSSQLDef, FireDAC.VCLUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Datasnap.Provider, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client;type TServerMethods1 = class(TDSServerModule) FDConnection1: TFDConnection; FDQuery1: TFDQuery; DataSetProvider1: TDataSetProvider; private { Private declarations } public { Public declarations } function EchoString(Value: string): string; function ReverseString(Value: string): string; procedure Select(v_str:string); procedure Execsql(v_str:string); end;implementation{$R *.dfm}uses System.StrUtils;function TServerMethods1.EchoString(Value: string): string;begin Result := Value;end;procedure TServerMethods1.Execsql(v_str: string);var v_qry:TFDQuery;begin try v_qry:=TFDQuery.Create(nil); v_qry.Connection:=FDConnection1; with v_qry do begin Close; SQL.Clear; sql.Add(v_str); try ExecSQL; except //写日志 end; end; finally v_qry.Free; end;end;function TServerMethods1.ReverseString(Value: string): string;begin Result := System.StrUtils.ReverseString(Value);end;procedure TServerMethods1.Select(v_str: string);begin try with FDQuery1 do begin Close; SQL.Clear; sql.Add(v_str); Active:=True; end; except end;end;end.

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复