Board index » delphi » Getting CommandText List Items

Getting CommandText List Items


2005-04-16 04:59:14 AM
delphi155
With a TADODataSet connected to an Access database, in the IDE, the OI
will present you with a list of CommandText items (Tables or Queries)
depending on the CommandType you've selected. Is there a method to get
this list at run time?
I want to populate a list box with available stored procedures
(Queries).
--
Dave Keighan
XanaNewser [ 1.17.3.1]
 
 

Re:Getting CommandText List Items

Dave Keighan,
Quote
I want to populate a list box with available stored procedures
(Queries).
I've been browsing ADODB, have the distinct impression I have been
looking in the wrong place. I have found
TADOConnection.GetTableNames(...) which get both TABLEs and VIEWs but
not quite what I want - I only want VIEWs (at least I am pretty sure
that's what I want).
I'll poke around until I can come up with it :)
Any assistance is appreciated.
--
Dave Keighan
XanaNewser [ 1.17.3.1]
 

Re:Getting CommandText List Items

Brian,
Thanks very much.
Quote
see TadoConnection.OpenSchema

to just get Views use
ADOConnection1.OpenSchema(siTables,VarArrayOf([Unassigned,Unassigned,U
nassigned,'VIEW']),Empty Param,ADODataSet1)
Ewww, that looks *{*word*193}*... but ... I will have a look :)
--
Dave Keighan
XanaNewser [ 1.17.3.1]
 

Re:Getting CommandText List Items

Brian,
Quote
see TadoConnection.OpenSchema
Again, thanks. I found some directly applicable code (just does tables)
by Carlo Pasolini, Riccione(Italy) at Swiss Delphi Center:
www.swissdelphicenter.ch/en/showcode.php
(link is more for others that read this post than for you ... obviously)
Seems a great place to start and get a handle on this very useful
Method.
I may throw together the example I have once I add a few features to it
and put it up on Code Central for others - after I have someone check
it for me, of course :)
--
Dave Keighan
XanaNewser [ 1.17.3.1]