Hello Anyone,
I was new RTC SDK users to upgrade my previous application using DataSnap. but I find obstacles to implement the database connection. where before I use it the way there like on the blog Andreano lanuse(
http://www.andreanolanusse.com/en/sharing-db-connection-between-multiples-datasnap-server-modules/).
In RTC I have not gotten TDSSessionManager.GetThreadSession.Id like in DataSnap.
so this time I made the connection at runtime just like the following:
procedure TdmServer.InsertMemberFuncExecute(Sender: TRtcConnection;
Param: TRtcFunctionInfo; Result: TRtcValue);
var
conn: TFDConnection;
Member: TMEMBERS;
begin
conn := TFDConnection.Create(nil);
Member := TMEMBERS.Create;
try
with conn do
begin
Params.Values['DriverID'] := 'FB';
Params.Values['Server'] := 'localhost';
Params.Values['Database'] := sLocationDb;
Params.Values['User_Name'] := sUser_Name;
Params.Values['Password'] := sPassword;
LoginPrompt := False;
Connected := True;
end;
Member.ConDB := conn;
..................................
................................
Member.ConDB := nil;
conn.Close;
finally
FreeAndNil(Member);
FreeAndNil(conn);
end;
end;
there anything you can share the right way.
Thank you.