Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Meta data of a Recordset in Visual Basic
Message
 
To
07/04/2000 06:51:40
General information
Forum:
Visual C++
Category:
Other
Miscellaneous
Thread ID:
00356721
Message ID:
00357055
Views:
16
>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 ?

Using ADO, 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

Next time, place your question in the VB forum! ;~)
É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