Wise Owl Answers - How do I get the column names from an ADO recordset?

Published: 26 April 2021
on channel: WiseOwlTutorials
3,652
81

Check out our other answers here    • Wise Owl Answers  

Get files here https://www.wiseowl.co.uk/vba-macros/...

If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos, you can click this link https://www.wiseowl.co.uk/donate?t=1​ to make a donation. Thanks for watching!

When you copy data from a recordset into an Excel worksheet you don't get the column headings by default. This video shows you two ways to loop through the Fields collection and write out the Name property of each Field object into the worksheet.

Chapters
00:00 The Question
02:09 Counting Through the Fields Collection
03:48 Referring to a Field Object
05:33 Writing Names into the Worksheet
06:40 Using a For Each Loop
09:22 Why Doesn't the Field Class Appear?
13:37 Writing Names into the Worksheet
14:36 Selecting Specific Columns
15:34 Discovering the Column Names in a Workbook

Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Power BI, DAX, SQL Server, Reporting Services, Analysis Services, Integration Services, ASP.NET, C#, Visual Basic, Microsoft Access and more


Watch video Wise Owl Answers - How do I get the column names from an ADO recordset? online without registration, duration hours minute second in high quality. This video was added by user WiseOwlTutorials 26 April 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,652 once and liked it 81 people.