青
青云
Unregistered / Unconfirmed
GUEST, unregistred user!
在sqlserver自带的ide工具Microsoft SQL Server Management Studio里;我们可以执行SQL: select 1 select 2就可以显示两个dbgrid,分别为1,2这个好像在Delphi里ado,dbExpress没法实现;有个空间叫SDAC 或者UniDAC可以用 uniQuery.OPen;获取第一个数据集,用UniQuery.OpenNext 获取下一个;不过不能一下子显示两个;于是我问了这家官方公司,它也没有好方法。我提问的邮件是:thank you very much!but I have no way to display multi-DataSet by One SQL at once.for example: uniQuery1.Sql.text:='select 1 select 2';I want to display it by Tdatasoucre + Tdbgrid;if execute: uniQuery1.open; then get '1' in dbgrid ;if execute :uniQuery1.openNext; then get '2' in dbgrid; but I noly can get one of them in dbgrid ;How can i get '1' and '2' in dbgrid1 and dbgrid2 together. I think we can do it by TClientDataSet + TDataSetProvider .but it's not a good way.I want do it by only UniDAC; In fact ,I am doing a IDE tools for mssql .I have finished a IDE tools for oracle like toad for oracle ,pl/sql developer etc. I know that :"Toad for sqlserver" And "Microsoft SQL Server Management Studio" can display multi-DataSet in multi-dbgrid by one Sql ;SO,I want to know witch way can do it! In Fact ,I think make a SQL TOOL Like Toad for mssql is difficult .for example :a Sql is : = ' update ... select ...update....exec procedure.. select ...'; if we want to execute it.we can not use UniQuery.open,because we do not know what is the sql(select ,update ,insert,exec procedure..etc.)we have to user " UniQuery.Execute " and then judge "UniQuery.IsQuery" to display dataset we execute ' update ... select ...update....exec procedure.. select ...' by " UniQuery.Execute " . it only can execute 'update ... select ...',UniQuery execute sql until get the first DataSet.we lost the next 'update....exec procedure.. select ...';SO ,I want to know witch way to Execute All sql in a multi-sql And Get all DataSet in DbGrids! I hope like this:------------------------------------------ var sSql:string; i:integer; begin sSql:='update...select...exec procedure..insert..select..'; uniquery1.sql.text:=sSql; uniquery1.ExecuteAll; for i:=0 to uniquery1.ExeCount-1 do begin if uniquery1.execute.IsQuery then begin datesource:=Tdatasource.create; datesource.name:='datesource'+inttostr(i); datesource.dataset:=uniquery1 dbgrid:=Tdbgrid.create; dbgrid.name:='dbgrid'+inttostr(i); dbgrid.datasoucre:=datesource; end else memo1.lines.add('uniquery1.RowsAffected is '+inttostr(uniquery1.RowsAffected )); end; end; 在2010-01-19 17:15:36,support <support@devart.com> 写道:>Hello.>>To get second dataset you should use the OpenNext method. But you can't open two datasets at once.>>Best regards,>Dmitry>Devart Team>www.devart.com>>>Ticket Details>===================>Ticket ID: 10164>Department: Dac Team>Priority: Medium>Status: On Hold