首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

摘要: 这是可能需要的函数: System.AllocMem; System.AllocMemCount; System.AllocMemSize; System.Dispose; System.Finalize; System.FreeMem; System.FreeMemory; System.GetHeapStatus; System.GetMem; System.GetMemory; Syst... 阅读全文

posted @ 2008-12-11 13:24 colincode 阅读(252) 评论(0) 推荐(0) 编辑

2012年11月7日

摘要: SQL分页语句有关分页 SQL 的资料很多,有的使用存储过程,有的使用游标。本人不喜欢使用游标,我觉得它耗资、效率低;使用存储过程是个不错的选择,因为存储过程是经过预编译的,执行效率高,也更灵活。先看看单条 SQL 语句的分页 SQL 吧。方法1:适用于 SQL Server 2000/2005SELECTTOP页大小*FROMtable1WHEREidNOTIN(SELECTTOP页大小*(页数-1) idFROMtable1ORDERBYid)ORDERBYid方法2:适用于 SQL Server 2000/2005SELECTTOP页大小*FROMtable1WHEREid>(SE 阅读全文

posted @ 2012-11-07 16:17 colincode 阅读(251) 评论(1) 推荐(0) 编辑

2011年12月3日

摘要: 本话题会涉及到: Lo、Hi、HiByte、LoWord、HiWord、MakeWord、MakeLong、Int64Rec--------------------------------------------------------------------------------譬如有一个 Cardinal 类型的整数: 1144201745其十六进制的表示是: $44332211其二进制表示是: 01000100 00110011 00100010 00010001我们说 Cardinal 是 32 位的整数, 这里的位是指 "二进制的位数", 不信你数数.我们需要重 阅读全文

posted @ 2011-12-03 15:00 colincode 阅读(331) 评论(0) 推荐(1) 编辑

摘要: 方法一Delphi进制转换(二进制/十进制/十六进制) 2011-05-18 10:49一、完全用API完成:..uses Windows;function IntToStr(I: integer): string;beginStr(I, Result);end;function StrToInt(S: string): integer;beginVal(S, Result, Result);end;function HexToInt(Const HexValue: String) : Integer;beginVal('$'+HexValue, Result, Result) 阅读全文

posted @ 2011-12-03 13:54 colincode 阅读(439) 评论(0) 推荐(0) 编辑

2011年8月10日

摘要: 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 @ 2011-08-10 09:08 colincode 阅读(1234) 评论(0) 推荐(0) 编辑

2011年8月9日

摘要: 其实很简单,要充分利用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 ; FieldByName( 阅读全文

posted @ 2011-08-09 15:16 colincode 阅读(573) 评论(0) 推荐(0) 编辑

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

posted @ 2011-08-09 15:15 colincode 阅读(459) 评论(0) 推荐(0) 编辑

摘要: 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 * from 阅读全文

posted @ 2011-08-09 15:09 colincode 阅读(795) 评论(0) 推荐(0) 编辑

摘要: if SQLConnection.InTransaction then begin ShowMessage('数据库服务忙,请稍候保存'); exit; end; 阅读全文

posted @ 2011-08-09 14:52 colincode 阅读(1016) 评论(0) 推荐(0) 编辑

摘要: 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&# 阅读全文

posted @ 2011-08-09 14:49 colincode 阅读(584) 评论(0) 推荐(0) 编辑

摘要: 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 @ 2011-08-09 14:46 colincode 阅读(512) 评论(0) 推荐(0) 编辑