Hi Danijel,
I have made the code below.
Wil you please check of this is correct?
How do I get the records in the memory table?
// CODE IN THE CLIENT (TABLET)
procedure TStartscherm.VerstuurWerkopdrachtenKlaar;
var
URL_str: string;
IdHTTP_Verstuur: TIdHTTP;
begin
rtcDS:=TRtcDataSet.Create;
DM1.nxQ_AantalOpdrachtenTeVersturen.Open; {= nxQuery}
if DM1.nxQ_AantalOpdrachtenTeVersturen.RecordCount > 0 then
begin
// URL aanroep:
http://80.61.179.222:22333/tbid_wtr1?xx=DF45 - xx=tabletID
URL_str := 'http://' + DM1.nxT_TabletID.FieldByName('Webserver_Z').AsString + ':' + DM1.nxT_TabletID.FieldByName('Poort')
.AsString + '/TBID_WO_Retour1?xx=' + DM1.nxT_TabletID.FieldByName('Tablet_ID').AsString;
DelphiDataSetToRtc(DM1.nxQ_AantalOpdrachtenTeVersturen, rtcDS, False, True);
IdHTTP1.Post(URL_str, rtcDS.asByteStream['RecordStrm']);
DM1.nxQ_AantalOpdrachtenTeVersturen.Close;
end;
end;
// CODE IN THE SERVER SERVICE
procedure TWork.DP_WerkopdrachtenRetourCheckRequest(Sender: TRtcConnection);
var
TBID: string;
test: string;
begin
with Sender as TrtcDataServer do
begin
// test := UpperCase(Request.FileName);
// URL aanroep:
http://80.61.179.222:22333/tbid_b1?xx=DF45 - xx=tabletID
if Request.FileName = '/TBID_WO_Retour1' then
begin
TBID := Request.Query.ItemValue[0];
TBID3 := TBID;
if DM1.nxT_Tablet_IDs.FindKey([TBID]) then
if DM1.nxT_Tablet_IDs.FieldByName('Actief').AsBoolean then
Accept;
end;
end;
procedure TWork.DP_WerkopdrachtenRetourDataReceived(Sender: TRtcConnection);
var
iChildL1, iStatus, iNodeBerichten, iNodeBericht: IXMLNode;
BerichtenQuery: string;
XML_aanvraag: RtcString;
XMLDoc4, XMLDoc9: TXMLDocument;
XML_bericht: RtcString;
rtcDS : TRtcDataSet;
nxMT : TnxMemTable;
begin
try
with Sender as TrtcDataServer do
begin
if Request.Complete then
try
rtcDS := TRtcDataSet.Create;
nxMT := TnxMemTable.Create;
nxMT.Open;
rtcDS.asByteStream[Server. <================???
RtcDataSetFieldsToDelphi(rtcDS, nxMT);
except
on E: Exception do
end;
end;
finally
rtcDS.Free;
nxMT.Free;
end;
end;