Check out our other answers here https://youtube.com/playlist?list=PLNIs-AWhQzcluqE43JKakRKslaYwCouJu

Get files here https://www.wiseowl.co.uk/vba-macros/videos/vba-ado-net-recordsets/filename-adodb-query/

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're extracting information from multiple files using ADO it can be helpful to include the filename for each row of data. This video shows you how to include a new column in the select list of your query so that you can identify which file a row of data belongs to.

Chapters
00:00 The Question
02:17 Adding Extra Columns to a Query
04:13 Concatenating the File Name
05:59 Selecting Specific Columns
07:15 Getting Field Names from a Recordset
09:29 Assigning an Alias to a Column
10:27 Listing Field Names Only Once

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