RTC Forums
November 01, 2024, 01:34:42 PM
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
>
Record to DB Field
Pages: [
1
]
« previous
next »
Print
Author
Topic: Record to DB Field (Read 4101 times)
ISIGest
RTC Expired
Posts: 121
Record to DB Field
«
on:
February 13, 2015, 12:28:44 PM »
Hi Danijel, could you tell me if there is a function to convert a value type to to DB Field type?
I see the "RTC_FIELD2DB_TYPE" function but it accept a "TRtcFieldTypes" param and not "TRtcValueTypes"...
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: Record to DB Field
«
Reply #1 on:
February 13, 2015, 12:44:11 PM »
There is no direct co-relation between a RTC
Value
Type and a DB
Field
Type, because these are two completely different things. Only RTC
Field
types have a direct 1:1 relation to Delphi DB Field types. TRtcDataSet class has a FieldType property, which accepts a TRtcFieldType value to specify a DB Field Type and that is what you should use to set a DB Field type when using a TRtcDataSet to send DB-related data. If you are looking for examples on moving data between a TRtcDataSet and a TDataSet, check the "rtcDB.pas" unit and you will find these functions:
// Copy data from a Delphi TDataSet into a TRtcDataSet (used for transport)
procedure
DelphiDataSetToRtc
(DelphiDS:TDataSet; rtcDS:TRtcDataSet;
ClearFieldDefs:boolean=True; OnlyDataFields:boolean=True);
// Copy data from a Delphi TDataSet into a TRtcArray of TRtcRecords (used for transport)
procedure
DelphiDataSetToRtcArray
(DelphiDS:TDataSet;
rtcArr:TRtcArray; OnlyDataFields:boolean=False);
// Copy field definition from a TRtcDataSet (used for transport ) to a Delphi TDataSet
procedure
RtcDataSetFieldsToDelphi
(rtcDS:TRtcDataSet; DelphiDS:TDataSet);
// Copy data rows from a TRtcDataSet (used for transport) to a Delphi TDataSet
procedure
RtcDataSetRowsToDelphi
(rtcDS:TRtcDataSet; DelphiDS:TDataSet);
Copy the implementation of these functions to your own unit and use them as a starting point for whatever you need to do.
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...