|
 |
sql_language thread: RE: sql_language digest: February 27, 2001
Message #1 by "Rick Dobson" <rddcab@i...> on Tue, 27 Feb 2001 20:02:12 -0500
|
|
Hi,
I agree with others that responded to this message. sp_columns is a
built-in stored procedure that works well from Query Analyzer. You can also
use it from Access Projects. My online article titled "Using Stored
Procedures with Access Projects" includes more commentary on sp_columns and
shows how to use. Its URL is
http://www.sqlmag.com/Articles/Index.cfm?ArticleID=8039.
You can additionally use ADO as another author suggested. Here the trick is
to point a recordset object at the table. Then, enumerate the Fields
collection of the recordset and print name property of each field. This
will name each column in the table to which the recordset points.
Yet antoher approach is to use SQL-DMO if you are using SQL Server as your
backend database. SQL-DMO exposes a COM interface for administering SQL
Server. Therefore, any programmer that can connect to a COM object can
programmatically administer SQL-DMO from their favorite programming
language, such as VBA in Access or stand-alone VB. My book, Professional
SQL Server Development with Access 2000, on pages 117-118 includes a
specific code sample that demonstrates how to enumerate the columns of a
table with SQL-DMO.
I hope that you find this reply helpful.
Rick Dobson
www.programmingmsaccess.com
www.cabinc.net
rickd@c... <mailto:rickd@c...>
|
|
 |