07 2013 档案

Server端更新数据后通知Client端显示
摘要:原来的Client的ApplyUpdatesError事件己经没有了换成 Client的RemoteDataAdapter的 BeforeProcessFailures 事件Server:ProcessorAfterProcessChange事件或ProcessorBeforeProcessChangeCanRemoveFromDelta := FALSE; case aChange.ChangeType of ctInsert : begin customerid := aChange.NewValueByName['CustomerID']; aChange... 阅读全文

posted @ 2013-07-23 16:00 leon_kin 阅读(271) 评论(0) 推荐(0)

客户端动态条件
摘要:有两种方法:一、首先要设置服务端的服务AllowWhereSQL为True;客户端with ClientDataModule.dtCustomers do begin Close; // Prepares the custom WHERE clause Where.Clear; Where.AddConditions(['CustomerIdx','FirstName','LastName','City'], [cEqual,cLike,cLike,cLike], [eCo... 阅读全文

posted @ 2013-07-23 15:58 leon_kin 阅读(260) 评论(0) 推荐(0)

DA中直接运行SQL命令,并返回影响行数
摘要:1 、 客户端直接运行SQL命令 , 使用TDARemoteCommand2 、 服务器端直接运行SQL命令 , 使用TDALocalCommandfunction DeleteRowFromTable1(aID: integer): integer;var lCommand: TDALocalCommand; linp, lout: DataParameterArray; i: integer;begin try lCommand := TDALocalCommand.Create(nil); lCommand.ServiceName := 'MyService'; ... 阅读全文

posted @ 2013-07-23 15:51 leon_kin 阅读(302) 评论(0) 推荐(0)

DA的存储过程 服务器端返回参数的应用方法
摘要:function TTJService.RQ_singleOP(const Rq_singlestru: STRU_RQ_L1): Integer; var acon: IDAConnection; SqlCMD: IDASQLCommand; SqlDST: IDADataset; sqltext: string; it:Integer; begin acon :=DAConnectionManager.NewConnection('EmployeeIBO', TRUE);; result :=0; try SqlCMD :=acon.NewCommand('RQOP 阅读全文

posted @ 2013-07-23 15:46 leon_kin 阅读(222) 评论(0) 推荐(0)

IDASQLCommand用法(包含事务)
摘要:procedure DoLogout(const Session:TROSession; Connection:IDAConnection; ServerLog:TDAServerLog);var Cmd : IDASQLCommand; CommandLog:TDASQLCommandLog; ErrorLog:TDASQLErrorLog;begin if (LogoutCommand'') then Cmd := ServiceSchema.NewCommand(Connection, 'Logout', ['SessionID'], [G 阅读全文

posted @ 2013-07-23 15:45 leon_kin 阅读(266) 评论(0) 推荐(0)

RO 本地sql动态指令检索使用方法
摘要:procedure TForm1.btn3Click(Sender: TObject); var lDataSet:IDADataSet; lConnection:IDAConnection ; stream: Binary; mytbl:TDAMemDataTable ; begin mytbl :=tbl1; lConnection := DAConnectionManager.NewConnection(DAConnectionManager.Connections[0].Name); lDataSet := lConnection.NewDataset('select * fr 阅读全文

posted @ 2013-07-23 15:39 leon_kin 阅读(330) 评论(0) 推荐(0)

DA EventRespository的应用
摘要:关于DA的事件的应用于理解 例子 FIleextendedtransfer 客户端 向服务器端提交 服务端时候,服务端可以同时让事件进行触发的操作。 事件触发以后,会向自己或者其他的客户端执行特殊的 客户端的部分的指令,如 download.... 服务器端是被动触发,触发后执行客户端指令。 比较有意思。 我们还可以对照聊天的例子。 httpchat的例子 { 服务端的代码} procedure TChatServerService.Talk(const Message: String); var ev: IChatEvents_Writer; begin ev := (EventReposi 阅读全文

posted @ 2013-07-23 15:37 leon_kin 阅读(188) 评论(0) 推荐(0)

RO dataabstract 如何使用text,或者是image字段(sqlserver)
摘要:其实很简单,要充分利用memorystream. 一存储text字段为例 1.如何进行存储? var ms:TmemoryStream; ms:=TMemoryStream .Create ; {将richedit的内容读取到内存流,并能存储}Frmtongzhi.Editor.Lines.SaveToStream(ms); ms.Seek(0,soFromBeginning ); with tbl_tongzhi do begin Edit; FieldByName('djtime').AsDateTime :=Frmtongzhi.bdate.date ; ... 阅读全文

posted @ 2013-07-23 15:35 leon_kin 阅读(282) 评论(0) 推荐(0)

数据敏感控件的制作。
摘要:八、数据敏感控件的制作。Delphi的一大亮点就是它的数据库开发能力。而数据敏感组件则在这中间起着很重要的作用。在Delphi的Data Control页面下的控件都是用于显示和编辑数据库中的数据的。相信大家已经体会到数据敏感控件的好处了。我们这一节就给大家演示一下数据敏感控件的开发方法。需要提醒大家的是,不像其他体系的控件,数据敏感控件并没有一个统一的基类,只要是从TwinControl类或其子类派生就可以,数据敏感控件的特殊之处就在于我们下面提到的数据连接。相信用Delphi开发过数据库的人一定对delphi中没有一个日期数据敏感控件而恼火。每次都要我们自己处理数据的更新与显示。所以我们就 阅读全文

posted @ 2013-07-23 13:35 leon_kin 阅读(321) 评论(0) 推荐(0)

DA服务器端 执行SQL命令 和查询 SQL语句
摘要:procedure TNewService.testoperation;var Cmd : IDASQLCommand; acon: IDAConnection; SqlDST: IDADataset;begin acon := ServerDataModule.ConnectionManager.NewConnection('New ADO Connection to ColinCodeData',true) ; Cmd := acon.NewCommand('',stSQL); Cmd.SQL := 'update table_1 set a = & 阅读全文

posted @ 2013-07-20 18:04 leon_kin 阅读(306) 评论(0) 推荐(0)

自定义一个消息
摘要:定义一个消息需要两个步骤: 1.声明一个消息标识符 2.声明一个消息记录类型一个消息标识符是一个整数大小的常数。Windows自用低于1024的消息,所以当你声明你自己的消息,你应该开始高于这一数字。 常数WM_APP代表了用户定义的消息开始编号。当定义消息标识符,你应该基于WM_APP它们。(这是因为WM_USER所代表1024以后的消息编号,有一些已经被Windows标准组件占用了,为了避免冲突,使用WM_APP) 如果你想给你的消息一个有用的参数名,你需要声明该消息的消息记录类型。消息记录是传递给消息处理方法的参数类型。如果你不使用消息的参数,或者如果你想使用旧风格的参数表示法(wPar 阅读全文

posted @ 2013-07-11 11:20 leon_kin 阅读(302) 评论(0) 推荐(0)

实现已生成组件的拖动
摘要:Perform(Msg: Cardinal; WParam: WPARAM; LParam: LPARAM): LRESULT; overload;其中Msg用WM_SYSCOMMANDWParam用SC_SIZE OR 9LParam用0就可以实现已生成组件的拖动。?123456procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin ReleaseCapture; Button1.Perform(WM_SYSCOMMAND 阅读全文

posted @ 2013-07-11 08:41 leon_kin 阅读(371) 评论(0) 推荐(0)