' Create a HTML table from a recordset'' set the TableAttribs argument to a suitable value' (eg "BORDER=1") to modify the table's standard layout' you should omit the NullValues argument if you want that null' values are displayed in empty cells' set the ShowFieldNames to True to display field names in boldface' set the IncludeWhiteSpace argument to True if you want to produce' a longer and less efficient (but more readable) outputFunction RecordsetToHTMLTable(rs As ADODB.Recordset, _ ByVal TableAttribs As String, Optional ByVal NullValues As String = _ " ", Optional ByVal ShowFieldNames As Boolean, _ Optional ByVal IncludeWhiteSpace As Boolean) As String Dim res As String Dim fld As ADODB.Field Dim tmp As String Dim lf As String, tb As String ' fill these variables only if spaces are to be kept If IncludeWhiteSpace Then lf = vbCrLf tb = vbTab End If ' prepare the tag res = "" & lf ' show field names, if required If ShowFieldNames Then res = res & tb & "" & lf For Each fld In rs.Fields res = res & tb & tb & "" & fld.Name & " " & lf Next res = res & tb & "" & lf End If ' get all the records in a semi-formatted string tmp = rs.GetString(, , "" & lf & tb & tb & "", _ " " & lf & tb & "" & lf & tb & "" & lf & tb & tb & "", _ NullValues) ' strip what has been appended to the last cell of the last row tmp = Left$(tmp, Len(tmp) - Len(lf & tb & " " & lf & tb & tb & "")) ' add opening tags to the first cell of the first row of the table ' and complete the table RecordsetToHTMLTable = res & tb & " " & lf & tb & tb & "" & tmp & lf _ & "
" End Function
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
Related Posts
About Our Editorial Process
At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.
See our full editorial policy.
What Businesses Should Consider When Selecting Perimeter Security Solutions
Steve Gickling
November 30, 2026
4:44 PM
What Is Anthropic’s Messages API Rust Rewrite? AI-Verified Migration Explained
Deanna Ritchie
November 30, 2026
11:18 AM
What Is Gemini 4 Neon? Google’s New Mid-Tier AI Model Explained
Steve Gickling
November 27, 2026
8:12 AM
What Is AI-Assisted Vulnerability Research? Chrome 158’s Claude-Found Bugs Explained
Rashan Dixon
November 26, 2026
8:02 AM
The Cheapest Ways to Run an AI Agent 24/7 in 2027 (Ranked)
John Rampton
November 25, 2026
1:52 PM
What Is Java4Shell? The Critical OpenJDK Base64 Vulnerability Explained
Deanna Ritchie
November 25, 2026
8:05 AM
What Is the Agent-Framework PyPI Attack? Microsoft’s Credential Stealer Explained
Steve Gickling
November 24, 2026
7:59 AM
One Design System for the Product and the Marketing Site, or Two?
Rashan Dixon
November 23, 2026
3:12 PM
What Is NGINX2Root? The Critical NGINX RCE Vulnerabilities Explained
Rashan Dixon
November 23, 2026
7:28 AM
How Fintech Is Transforming the Way Consumers Manage Monthly Bills
Steve Gickling
November 20, 2026
11:53 AM
What Is .NET 11? C# 15 Union Types and AI Tooling Explained
Deanna Ritchie
November 20, 2026
10:51 AM
Just-in-Time Privileged Access Should Be Scoped to Tasks, Not People
kellybryson
November 19, 2026
2:19 PM
What Is Windows 11’s Coding Agent Telemetry? Privacy Risk Explained
Steve Gickling
November 19, 2026
7:41 AM
What Is the cPGuard Supply Chain Attack? OpsShield’s Backdoor Explained
Rashan Dixon
November 18, 2026
8:31 AM
What Is wfx-loot? The GitHub Actions Secret Stealer Attack Explained
Deanna Ritchie
November 17, 2026
8:38 AM
What Is Gemini 4 Hydrogen? Google’s Fast, Low-Cost Coding Model Explained
Steve Gickling
November 16, 2026
8:08 AM
What Is GPT-6 Cyber? OpenAI’s New Cybersecurity AI Model Explained
Rashan Dixon
November 13, 2026
8:08 AM
What Is Microsoft’s November 2026 Patch Tuesday? Outlook Zero-Day Explained
Deanna Ritchie
November 12, 2026
8:08 AM
What Is Claude Fable 5.2? Anthropic’s New Flagship Model Explained
Steve Gickling
November 11, 2026
8:12 AM
What Is DeepSeek Super-Agent? DeepSeek’s Open Source Coding Agent Explained
Rashan Dixon
November 10, 2026
7:52 AM
What Is the Meta Conductor Acquisition? AI Coding Agents Explained
Deanna Ritchie
November 9, 2026
8:07 AM
Exploring How Service Robots Navigate Everyday Unpredictability with LiDAR
Steve Gickling
November 6, 2026
2:33 PM
What Is the Cloudflare Deno Acquisition? Explained
Editorial-team
November 6, 2026
8:18 AM
What Is FlashProve? Anthropic’s New Way to Verify AI Model Identity
Rashan Dixon
November 5, 2026
10:08 AM
What Is Recursive Self-Improvement in AI? Anthropic’s Warning Explained
Deanna Ritchie
November 4, 2026
8:05 AM
























