Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Meta Data of a RecordSet
Message
 
To
11/04/2000 02:19:55
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00357837
Message ID:
00357883
Views:
14
>Can any one tell me how to get the meta data of recordset in
>Visual Basic.
>
>Say a Record Set contain Three Columns
>====================================
>Column Data Length Decimals
>Name Type
>====================================
>NAME String 40
>AGE Integer 2 0
>SALARY Money 12 2
>====================================
>
>HOW TO GET THESE DETAILS (COLUMN_NAME,
>DATA_TYPE, LENGTH, DECIMALS) OF THE COLUMNS
>IN A RECORDSET ?

I already answer this to you last week in the Visual Studio forum.

Using ActiveX Data Objects, you can use OpenSchema to read columns info.
Dim rstSchema As ADODB.Recordset

Set rstSchema = mdbConnect.OpenSchema(adSchemaColumns, Array(Empty, Empty, "TableName"))
With rstSchema
   Do Until .EOF
      On Error Resume Next
      msgbox !COLUMN_NAME
      .MoveNext
   Loop
   .Close
End With
Set rstSchema = Nothing
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform