Query tool

Query tool

Post by Steve Har » Thu, 05 Jul 2007 04:26:16


Hi All,

I'm writing a query tool to deploy in an application. I need 2
things:

1. The TADOQuery component barfs on GO statements so I can't use it to
execute alter procedure scripts. Is there a component that will work
like the query tool in MS SQL Server Manager?

2. How can I tell if the user has entered a select statement which
would return a result set, an Update/Insert, statement or a script
with possibly several Alter Procedure, Alter Table, etc actions?

Thanks,
Steve
 
 
 

Query tool

Post by Vassiliev » Thu, 05 Jul 2007 06:00:29

> 1

Just load it into TStringList and separate commands by GO.


Execute all the same way, using TADOCommand, for example. Update/Insert will
return empty recordsets. You will have also handle queries that return
multiple recordsets, some of them can be empty:

insert into mytable (col1, col2) values (a, b)
select * from mytable


//------------------------------------------
Regards,
Vassiliev V. V.
http://www.yqcomputer.com/ - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.yqcomputer.com/ - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)



"Steve Harp" < XXXX@XXXXX.COM > ???????/???????? ? ????????