Retrieve multi-result set with ADO (Delphi)
来源:互联网 发布:淘宝刷钻是真的吗 编辑:程序博客网 时间:2024/06/05 09:41
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids, FMTBcd, DBXpress,
DBClient, ComObj;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
AQry: TADOQuery;
ADS: TCustomADODataSet;
RowAffected, Seq: Integer;
begin
AQry := TADOQuery.Create(Self);
ADS := TCustomADODataSet.Create(Self);
AQry.ConnectionString :=
'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=.';
AQry.SQL.Text := 'select * from jobs' + #13#10 + ' select * from employee';
Seq := 1;
try
AQry.Open;
ADS.Recordset := AQry.Recordset;
while ADS.Recordset <> nil do
begin
TfrmData.CreateDataForm(Self, ADS.Recordset, Seq).Show;
Inc(Seq);
ADS.Recordset := AQry.NextRecordSet(RowAffected);
end;
finally
FreeAndNil(AQry);
FreeAndNil(ADS);
end;
Button1.Enabled := false;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids, FMTBcd, DBXpress,
DBClient, ComObj;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
AQry: TADOQuery;
ADS: TCustomADODataSet;
RowAffected, Seq: Integer;
begin
AQry := TADOQuery.Create(Self);
ADS := TCustomADODataSet.Create(Self);
AQry.ConnectionString :=
'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=.';
AQry.SQL.Text := 'select * from jobs' + #13#10 + ' select * from employee';
Seq := 1;
try
AQry.Open;
ADS.Recordset := AQry.Recordset;
while ADS.Recordset <> nil do
begin
TfrmData.CreateDataForm(Self, ADS.Recordset, Seq).Show;
Inc(Seq);
ADS.Recordset := AQry.NextRecordSet(RowAffected);
end;
finally
FreeAndNil(AQry);
FreeAndNil(ADS);
end;
Button1.Enabled := false;
end;
end.
- Retrieve multi-result set with ADO (Delphi)
- MDX + T-SQL: Combining relational and multi-dimensional data into one query result set
- ADO.NET的新功能:MARS(Multiple Active Result Set) 及 异步执行命令
- Delphi ADO
- Result Set not updatable
- oracle Result Set Caching
- How to set up a multi-domain SSO demonstration for a quick start with CAS.
- result set type is TYPE_FORWARD_ONLY
- After end of result set
- Before start of result set
- Result set type is TYPE_FORWARD_ONLY
- Before start of result set
- Before start of result set
- Result Set not updatable解决办法
- Delphi 5 ADO
- Delphi 5 ADO
- Delphi 5 ADO
- Delphi 7 ADO使用
- 通过异常处理错误
- 利用AJAX技术提高搜索引擎排名
- 实现业务系统中的用户权限管理--设计篇
- C#簡單操作XML
- UML软件工程组织 推荐
- Retrieve multi-result set with ADO (Delphi)
- 利用系统自带命令搞定手工杀毒
- 揭开伟大架构师的秘密
- 使用AJAX技术构建更优秀的Web应用程序
- Visual Studio 2005文档中有用的资源
- 实现业务系统中的用户权限管理--实现篇
- 积极人生的台阶
- 创建一个扩展DLL——CExtensionDLL项目
- 将IP最后一位替换为星号