RTC Forums
November 24, 2024, 03:34:45 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
ADO Connection Object
Pages: [
1
]
« previous
next »
Print
Author
Topic: ADO Connection Object (Read 5149 times)
zsleo
RTC Expired
Posts: 80
ADO Connection Object
«
on:
December 08, 2015, 02:19:26 AM »
Has anyone passed an ADO Connection Object as an RTC Param.
On the RTC client I use:
with rtclntmdlReport do
begin
StartCalls;
try
with Data.NewFunction('RunReport') do
begin
Value['Connection'] := UserSession.conMSQLSite.ConnectionObject;
end;
Call(rtcrsltReport);
finally
Post;
end;
end;
The app compiles without error.
On the RTC Server I use:
conMSQL.ConnectionObject := Param.asObject['Connection'];
I get a compile error:
[DCC Error] AppServer_Module.pas(135): E2010 Incompatible types: '_Connection' and 'TRtcValueObject'
In both client and server the ADO component I use is a TADOConnection
All suggestions and help will be appreciated.
TIA
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: ADO Connection Object
«
Reply #1 on:
December 08, 2015, 02:17:37 PM »
You can not pass an
Object
as a parameter to a remote function call and expect the same Object to be available on the remote side. There is no compile error on the Client side only because the
Value
property is declared as
Variant
to simplify assignment operations, but there is no mapping between an arbitrary TObject to a RTC Value. You should get an exception at runtime on the Client-side, though.
PS. If you are looking for examples on accessing a Database remotely using the RTC SDK, check Projects contained in the
SDKDemos_VCL_DBA
and
SDKDemos_FMX_DBA
Project Groups.
Best Regards,
Danijel Tkalcec
Logged
zsleo
RTC Expired
Posts: 80
Re: ADO Connection Object
«
Reply #2 on:
December 08, 2015, 11:42:26 PM »
Danijel
Thanks for the reply.
I did look at the examples prior to posting the request.
I tried the method in my post after I experienced connection problems.
In my original implementation I posted the TADOConnection details as RTC Params and established a new DB connection for each session. In every instance the DB connection is established successfully.
The problem I have with this is that the first time I post the request the TADOQuery(s) linked to the TADOConnection almost always report DB not connected. If I re-post the request then the TADOQuery(s) always work correctly.
DB Pooling is unlikely to be an option because each RTC session can request TADOConnection connect to any one of many (potentially more than 50) databases.
I am still working to find a solution.
Best Regards
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: ADO Connection Object
«
Reply #3 on:
December 09, 2015, 10:02:45 AM »
Good luck finding the best solution.
Best Regards,
Danijel Tkalcec
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...