Board index » delphi » Reading the definition of a view

Reading the definition of a view


2004-05-05 06:57:52 PM
delphi72
I'm working on a project to help document our Access databases, front end is
Delphi. I haven't been able to find a way of extracting the definition of
views (or queries as Access prefers to call them) other than by
interrogating the MSysQueries table directly. The disadvantage of this is
that I need to grant read permissions on this system table manually first -
which isn't really viable as a general purpose tool.
I'm using TADOConnection.OpenSchema to get a list of tables and views, and
also the fields that a view exposes, but I don't think this gives an option
to return how the view is constructed.
Does anyone know of an alternative approach to obtaining how a view is
constructed other than going to MSysQueries directly?
Thanks,
Brian.
 
 

Re:Reading the definition of a view

OpenSchema with siViews, field is VIEW_DEFINITION + siProcedures, field is
PROCEDURE_DEFINITION.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Brian Cryer" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях
следующе? news:4098c8b0$XXXX@XXXXX.COM...
Quote
I'm working on a project to help document our Access databases, front end
is
Delphi. I haven't been able to find a way of extracting the definition of
views (or queries as Access prefers to call them) other than by
interrogating the MSysQueries table directly. The disadvantage of this is
that I need to grant read permissions on this system table manually
first -
which isn't really viable as a general purpose tool.

I'm using TADOConnection.OpenSchema to get a list of tables and views, and
also the fields that a view exposes, but I don't think this gives an
option
to return how the view is constructed.

Does anyone know of an alternative approach to obtaining how a view is
constructed other than going to MSysQueries directly?

Thanks,

Brian.


 

Re:Reading the definition of a view

Excellent. Thanks. (Now why didn't I spot that before!)
"Viatcheslav V. Vassiliev" <XXXX@XXXXX.COM>writes
Quote
OpenSchema with siViews, field is VIEW_DEFINITION + siProcedures, field is
PROCEDURE_DEFINITION.

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

"Brian Cryer" <XXXX@XXXXX.COM>сообщи?сообщила ?
новостях
следующе? news:4098c8b0$XXXX@XXXXX.COM...
>I'm working on a project to help document our Access databases, front
end
is
>Delphi. I haven't been able to find a way of extracting the definition
of
>views (or queries as Access prefers to call them) other than by
>interrogating the MSysQueries table directly. The disadvantage of this
is
>that I need to grant read permissions on this system table manually
first -
>which isn't really viable as a general purpose tool.
>
>I'm using TADOConnection.OpenSchema to get a list of tables and views,
and
>also the fields that a view exposes, but I don't think this gives an
option
>to return how the view is constructed.
>
>Does anyone know of an alternative approach to obtaining how a view is
>constructed other than going to MSysQueries directly?
>
>Thanks,
>
>Brian.
>
>