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/column-data-type-adodb/
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!
This video explains how to check the Type property of a field in an ADODB recordset to determine its data type. You'll learn about the ADODB Data Type enumeration and how to translate the code numbers into meaningful descriptions. You'll also learn how to apply specific date or number formatting to a column based on its data type. The video also covers a bug with the CopyFromRecordset method which results in cells on the wrong worksheet being formatted as dates when you insert new worksheets.
Chapters
00:00 The Question
01:45 Discovering the Field Data Type
03:14 ADODB Data Types
05:17 Writing Field Names into the Worksheet
06:10 Checking for Date Columns
08:29 Applying a Custom Date Format
11:30 Changing the Selected Columns
12:38 Changing the Rows Returned
14:19 Formatting Numbers as Currency
17:06 Identifying Columns by Name
19:57 Writing Data to a New Worksheet
21:15 A Bug with Date Formats
24:05 Stepping Through the Subroutine
25:56 Explicitly Selecting the Added Worksheet
27:12 Performing More Actions before CopyFromRecordset
28:41 Other Options
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