共 14 篇文章 |
|
ELIB排序函数Ehlib3.0版本以上虽然支持排序功能,但不支持带有Order By的SQL语句,而且排序很慢;try if (Sender is TDBGridEh) and ((Sender as TDBGridEh).DataSet <>nil) then begin if not ((Sender as TDBGridEh).FieldName;FieldKind = fkData then SortStr := FieldName else if (Sender as T... 阅83 转0 评0 公众公开 11-07-01 11:34 |
Delphi的StringReplace 字符串替换函数。ShowMessage(StringReplace (aStr, ''a'', ''two'', [])); 阅2820 转3 评0 公众公开 11-06-27 10:17 |
阅1692 转22 评0 公众公开 11-06-21 15:47 |
DBGRIDEH自动(标题)列宽 //自动适应标题列宽 function DBGridRecordSize(mColumn: TColumn): Boolean;{ 返回记录数据网格列显示最大宽度是否成功 }begin.if not Assigned(mDBGrid) then Exit;if not Assigned(mDBGrid.Count - 1 do beginif not mDBGrid.Field) thenmDBGrid.Tag,mDBGrid.Caption)) + mOffsetelse mDBGrid.//自动适应标题... 阅885 转8 评0 公众公开 11-06-21 15:05 |
把DBGrid导出到Excel表格(支持多Sheet) {功能描述:把DBGrid输出到Excel表格(支持多Sheet)调用格式:CopyDbDataToExcel([DBGrid1, DBGrid2]);}for I := Low(Args) to High(Args) do begin XLApp.Name := TDBGrid(Args[I].for iCount := 0 to TDBGrid(Args[I].Cells[1, iCount + 1] := TDBGrid(Args[I].Eof do begin for iCoun... 阅672 转11 评0 公众公开 11-06-20 10:03 |
阅392 转13 评0 公众公开 11-06-17 16:52 |
delphi 定义全局变量delphi定义全局变量unit Unit1;TForm1 = class(TForm) Button1: TButton;{里面的str,和str2都是全局变量.str2只能在本单元全局访问,str既能在本单元全局访问,也能在其他单元访问,其他单元通过Unit1.str访问} 阅5525 转10 评0 公众公开 11-06-14 14:41 |
select ( case when (dept is null) then ''Grant total : '' else isNull(dept,'''') end ) as sect, ( case when (sect is null) and ( dept is not null) then ''total ( by Dept ) : '' else IsNull(sect,'''') end ) as sect, [Page]max(line) , max(title_code) , su... 阅375 转1 评0 公众公开 11-05-09 12:04 |
VB 建立多重窗体应用程序。2 UnLoad语句 格式:UnLoad窗体名称 该语句与Load语句的功能相反,它清除内存中指定的窗体。2列表窗体 列表窗体用来显示应用程序的内容,实际上它是一个对话框窗体。Visual Basic规定,对于多窗体程序,必须指定其中一个窗体为启动窗体;3多窗体程序的编译 多窗体程序可以编译生成可执行文件(.exe),而... 阅4442 转2 评0 公众公开 11-05-09 09:42 |
Set xlapp = CreateObject("excel.application")Set xlBook = xlapp.workbooks.Number <>0 Then Set xlapp = CreateObject("Excel.Application")Set xlBook = xlapp.workbooks.Path &"\学生.mdb;Persist Security Info=False"rs.CursorLocation = adUseClientrs.Open "学生信息表", cn, adO... 阅2180 转60 评0 公众公开 11-04-20 11:41 |