This article was previously published under Q193947
In an application, sometimes it is useful to determine the properties offields in a remote datasource. You can determine information such as thefield names, data types and field lengths by examining the Fieldscollection of the ActiveX Data Objects (ADO) Recordset object.
The following program creates a Recordset from the Authors table of the SQLServer sample Pubs database. It displays the field name, data type, anddefined length of each field in the Authors table.
The data type returns as an integer value. The #DEFINE statements at thetop of the program are included so that this value can be cross- referencedto a character description of the data type.
In order to use this example, you must have the Microsoft Data AccessComponents (MDAC) version 2.x or later installed, which is included in thedata components of Visual Studio 6.0 or can be downloaded from thefollowing Web address: