通用查询控件或代码,400分.

jyqkr 2003-01-06 01:29:55
通用查询控件或代码,象金蝶中的那种的也不错。
...全文
99 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
beata88 2003-04-11
  • 打赏
  • 举报
回复
up
小豆好好 2003-04-11
  • 打赏
  • 举报
回复
关注,以后就要用到了!
智商无下限 2003-04-11
  • 打赏
  • 举报
回复
我也想要一份!
bee2518 2003-04-10
  • 打赏
  • 举报
回复
关注
ideage 2003-04-10
  • 打赏
  • 举报
回复
帮忙@,谢谢
jyqkr 2003-01-27
  • 打赏
  • 举报
回复
象金蝶那样的
悟空师傅来了 2003-01-24
  • 打赏
  • 举报
回复
帮你up
yczyk 2003-01-24
  • 打赏
  • 举报
回复
你想做怎么样的呢?我不是很清楚呢!
xirumin 2003-01-06
  • 打赏
  • 举报
回复
金蝶软件的速度太慢了, 我用PB写过通用查询, 还可动态分三级以下的分组。
我也一直在找Delphi的通用查询
找到了, 好东西大家分享!!!
jyqkr 2003-01-06
  • 打赏
  • 举报
回复
lxmlhh(143143),有什么更好的?
lxmlhh 2003-01-06
  • 打赏
  • 举报
回复
金碾那太简单了,
我有更好的。
sexalpha 2003-01-06
  • 打赏
  • 举报
回复
我做查詢是用dll做的
提供數據庫名稱
讓dll中的form生成查詢語句
然後返回給應用程序
——————————————————————————
library FindDll;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
ShareMem,
SysUtils,
Classes,
UtFind in 'UtFind.pas' {FindFrm};

{$R *.res}
exports
FindShow;
begin
end.

unit UtFind;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DB, DBTables, ADODB, Buttons;

type
TFindFrm = class(TForm)
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RichEdit1: TRichEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Query1: TADOQuery;
ADOConnection1: TADOConnection;
ListBox1: TListBox;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ListBox2: TListBox;
Label1: TLabel;
RichEdit2: TRichEdit;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ListBox1DblClick(Sender: TObject);
procedure ListBox2DblClick(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
TBname:string; //數據庫名稱
FindSqlString:string; //返回的查詢字符串
public
{ Public declarations }
end;

//定義出口函數
function FindShow(H:THandle;TName:string):string;stdcall;

implementation

{$R *.dfm}

function FindShow(H:THandle;TName:string):string;
var
FindFrm: TFindFrm;
begin
application.Handle:=H;
FindFrm:=TFindFrm.Create(application);
try
FindFrm.Query1.SQL.Clear;
FindFrm.Query1.SQL.Add(TName);
FindFrm.ShowModal;
Result:=FindFrm.FindSqlString;
finally
FindFrm.Free;
end;
end;

procedure TFindFrm.Button1Click(Sender: TObject);
var aa,bb :string;
var c:integer;
begin
if RichEdit1.Lines.Text='' then
aa:=''
else
begin
if RadioButton1.Checked=True then
aa:='AND'
else
aa:='OR';
end;
c:=Pos(' ',ComboBox1.Text);
RichEdit2.Text:=RichEdit2.Text+' '+aa+' '+'('+copy(ComboBox1.Text,1,c-1)+' '+ComboBox2.Text+' '+''''+Edit1.Text+''')';
RichEdit1.Text:=RichEdit1.Text+' '+aa+' '+'('+copy(ComboBox1.Text,c+1,Length(ComboBox1.Text)-c-1)+' '+ComboBox2.Text+' '+''''+Edit1.Text+''')';
end;
procedure TFindFrm.Button3Click(Sender: TObject);
var i,n:integer;
var OrderStr,ListStr:string;
begin
//把生成的sql語句添加到FindSqlString中
if RichEdit1.Lines.Text<>'' then
FindSqlString:='SELECT * FROM '+trim(TBname)+' WHERE '+trim(RichEdit2.Text)
else
FindSqlString:='SELECT * FROM '+trim(TBname);
//加orderby
if ListBox2.Items.Text<>'' then
for i:=0 to ListBox2.Items.Count-1 do
begin
n:=Pos(' ',ListBox2.Items.Strings[i]);
ListStr:=copy(ListBox2.Items.Strings[i],1,n-1);
if i=0 then
OrderStr:=ListStr
else
OrderStr:=OrderStr+','+ListStr;
end;
//加dsc
if OrderStr<>'' then
begin
if RadioButton3.Checked=True then
OrderStr:=' ORDER BY '+OrderStr+' ASC'
else
OrderStr:=' ORDER BY '+OrderStr+' DESC';
end;
FindSqlString:=FindSqlString+OrderStr;
self.Close;
end;

procedure TFindFrm.Button4Click(Sender: TObject);
begin
FindSqlString:='';
self.Close;
end;

procedure TFindFrm.FormShow(Sender: TObject);
var i:integer;
var a:Tobject;
begin
TBname:=Query1.SQL.Text;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT MA003,MA004 FROM XADMA WHERE MA001='''+Trim(TBname)+'''');
RichEdit1.Lines.Text:='';
if Query1.Active=False then Query1.Open;
while not Query1.Eof do
begin
ComboBox1.AddItem(trim(Query1.FieldValues['MA003'])+' '+Query1.FieldValues['MA004'],a);
ListBox1.AddItem(trim(Query1.FieldValues['MA003'])+' '+Query1.FieldValues['MA004'],a);
Query1.Next;
end;
Query1.Close;
ComboBox1.ItemIndex:=0;
end;

procedure TFindFrm.Button2Click(Sender: TObject);
begin
RichEdit2.Text:='';
RichEdit1.Text:='';
end;

procedure TFindFrm.ListBox1DblClick(Sender: TObject);
var a:Tobject;
begin
if ListBox1.ItemIndex<>-1 then
begin
ListBox2.AddItem(ListBox1.Items.Strings[ListBox1.ItemIndex],a);
ListBox1.DeleteSelected;
end;
end;

procedure TFindFrm.ListBox2DblClick(Sender: TObject);
var a:Tobject;
begin
if ListBox2.ItemIndex<>-1 then
begin
ListBox1.AddItem(ListBox1.Items.Strings[ListBox2.ItemIndex],a);
ListBox2.DeleteSelected;
end;
end;

procedure TFindFrm.SpeedButton1Click(Sender: TObject);
begin
ListBox1DblClick(Sender);
end;

procedure TFindFrm.SpeedButton2Click(Sender: TObject);
begin
ListBox2DblClick(Sender);
end;

end.

調用時的代碼
Fstr:=FindShow(application.Handle,TableName);
smilelhh 2003-01-06
  • 打赏
  • 举报
回复
关注
项目名称:[精仿]360安全卫士-10.30更新(CSkin Demo) 界面库版本号:10.30 最新版本 下载内容: 精仿360安全卫士源码一份, 可引用至工具箱最新版CSkin.dll一份 实现功能: 1.发光标题。 2.直角边框和阴影。 3.360安全卫士主界面模仿。 4.多系统支持,不需要win8系统,即可实现win8风格的360。 5.自定义控件的美化使用。 界面库更新文档: CC2013-10.30 1.由于SkinForm名字太多人使用,界面库命名正式改为CSkin.dll,官网www.cskin.net。 2.SkinTabControl标签中添加菜单箭头,可点击展开菜单。 3.SkinTabControl添加标签关闭按钮。 4.修复部中文乱码问题。 5.优化好友列表右键菜单。 6.将窗体自定义系统按钮改为集合模式,可添加无数个自定义系统按钮。自定义系统按钮事件中可以 e.参数 来判断。 7.增加360安全卫士-DEMO案例。 8.增加SkinAnimatorImg控件,用于支持位图动画的播放。如360的动态logo。 9.各种细节BUG优化。 CC2013-10.11 1.添加SkinTabControlEx,加入更加自定义的美化属性和动画效果。 2.添加SkinAnimator,通用动画控件。 3.添加Html编辑器控件 4.修复SkinButton图标和文本相对位置的BUG CC2013-9.26 1.优化好友列表CPU占用 2.好友列表加入好友登录平台属性:安卓 苹果 WEBQQ PC 3.优化标题绘制模式,新添标题绘制模式属性。 4.新添标题偏移度属性。 5.加入圆形进度条控件:ProgressIndicator。 CC2013-9.5.2 1.优化截图控件,截图工具栏加入新功能。 2.解决个人信息卡和天气窗体显示后不会消失的问题。 3.各种细节BUG优化。 CC2013-9.5.1 1.解决贴边左右隐藏的BUG。 2.解决窗体点击事件不能触发的问题。 3.优化SkinButton继承父容器背景色的代码。 4.解决SkinButton异常错误。 CC2013-9.3 1.好友列表右键菜单没反应问题。 2.新增美化控件SkinDatagridview。 3.密码软件盘回删不了文字问题。 4.双击窗体最大化,最大化后再双击恢复原大小,(win7)。 5.部细节调优。 小编:下载不要,DEMO教你如何熟练使用CSkin界面库美化自己的窗体。 友情链接: http://bbs.csdn.net/topics/390510544 (精仿QQ2013局域通讯) http://download.csdn.net/detail/lyx_520/5710799 (C#实现Win8窗体)

5,927

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧