Wise Owl Answers - How do I add a filename to the results of an ADODB query?

preview_player
Показать описание


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

Рекомендации по теме
Комментарии
Автор

Thanks, Andrew for answering and featuring my question in the video. This ADO Playlist is becoming a great reference when it comes to "Using ADO in Excel". I can now confidently recommend this playlist to someone in search of the topic.

imranbhatti
Автор

Beautifully explained, the best vba channel on YouTube, Thank you Andrew, Cheers

janezklun
Автор

Very useful of course. Thank you very much for these videos which I consider priceless treasures.

KhalilYasser
Автор

Hi Andrew thank you for the compliment yesterday. I was able to solve those questions because I have best SQL teacher. Thank you so much for your amazing videos. You can explain even a complex concept very easily.

tejamarneni
Автор

Thanks Andrew. Did not know about Alias or AS. Very cool stuff.

krn
Автор

Thanks very much. This is amazing. Please could you share how to build connection in class module and call it in different VBA modules so that I don't need to create each connection each time in different modules.

VillaOuk
Автор

Hi Andrew,
Thank you so much

Sorry for so many questions so far we seen that reading the data of excel Under ADO vba

1 How to write to existing workbook under ado vba
Ex - I need to open every workbook in folder path (year wise movie file) add some data or information from thisworkbook

pannerselvammaruthachalam
Автор

Hi Andrew, You are really great teacher. I am stucked at some point, what if there is a blank sheet at workbook. It throws an error when you get the data with ADO

UzmanExcel
Автор

👏👏👏👏👏 excellent tutorial Andrew, I have learned so much of this very interesting top since you started with this, thank you so much,
To get the top 10 on the list is easy can you perhaps help with how to get bottom 10 on a list .

frikduplessis
Автор

In following along I had an error that prevented the column headers from being written out resulting in a date being entered into cell B1. However, the cell's format was General and the number displayed as an Integer instead of a Date, however the rows beneath were properly formatted as Dates. Is it correct to assume the "Sheet1.Cells.Clear" line clears only content and not formatting? I was confused because the original code did clear the formatting (Blue fill etc.). Thanks.

jerrydellasala
Автор

Is there a way to create unions between two SQL queries run against two worksheets in different workbooks? I can see how it can be done using the CSV file approach because the files all sit within the scope of a single connection, but I’ve not found a way to create Unions between recordsets derived from separate connections yet.

brencostigan