Turn: RTC builds Android under three-tier application access server mssql-server side

Source: Internet
Author: User
Tags mssql

Original: http://www.cnblogs.com/delphi007/p/3346061.html

A few days ago through the RO build WebService, and then cut in Android, although it has been nearly successful, but the return of the database of Chinese has been garbled has not been resolved!
rtc6.23 version, already support Xe5, also support FMX Android under development, not much to say, need please contact purchase!

First, create a service-side program:

1 according to the official demo, create the program, add Datamoudel, add the RTC related server-side control Trtchttpserver,trtcservermodule,trtcfunctiongroup,trtcfunction (2), 2 Adoquery, one adoconnection

2, set the control properties:

Set Trtchttpserver IP, port

Set the Functiongropu property of the Trtcservermodule, Moudelname,server, etc.

Set the Gropu property of the 2 trtcfunction to Trtcfunctiongroup and set one functionname to select and the other to up (one to get data, one to update data)

Set ADO properties (slightly)

3, writing code

function of Select

Procedure Tdatamodule3.rtcfnctn1execute (sender:trtcconnection; Param:trtcfunctioninfo; Result:trtcvalue); begin
Qry1. Close;
Qry1. Open;
DELPHIDATASETTORTC (Qry1,result.newdataset);//Returns a DataSet with a Result of RTC
Qry1. Close;
End

The function of up

Procedure Tdatamodule3.rtcfnctn2execute (sender:trtcconnection; Param:trtcfunctioninfo; Result:trtcvalue);
Begin
With Qry2 do begin
Close;
Sql. Text:= ";
Sql. text:= ' Update contact set name =:a, Birthday =:b, age =:c where contact id=:d ';
Parameters.parambyname (' a '). Value:=param.asstring[' a '];
Parameters.parambyname (' B '). Value:=param.asdatetime[' B '];
Parameters.parambyname (' C '). Value:=param.asinteger[' C '];
Parameters.parambyname (' d '). value:=param.asinteger[' d '];
Execsql;
result.asinteger:=execsql;//return value is the number of rows affected
End
End

Service side other code see demo, after running please click the button to start monitoring

Http://pan.baidu.com/s/1cea38

Turn: RTC builds Android under three-tier application access server mssql-server side

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.