Throwback Thursday: September 12, 2024

Today's edition of Throwback Thursday highlights my three most-used string functions: Conc(), Qt(), and Parse(), used to join words, quote words, and extract words.

Throwback Thursday: September 12, 2024

With over a million words scattered across more than 1,300 articles on this blog, you've probably missed a few things here.

That’s why each week in "Throwback Thursday," we’ll revisit some standout posts. Expect a blend of my personal favorites, insightful articles from other great minds, and a touch of coding humor to keep things light.


Highlights from NoLongerSet.com

The articles below cover my three most-commonly used string functions in my everyday Access programming:

  • Conc(): used to concatenate two strings with a delimiter when both strings are non-zero length; this function lets you avoid the annoying (and error-prone) step of stripping off a trailing delimiter at the end of a loop
Come Together
Do you build strings in loops? Stop trimming the delimiter at the end of the loop. There’s a better way.

  • Qt(): wraps strings in double quotes for use in SQL statements; properly escapes embedded double quotes and avoids the errors associated with using single quotes when the literal string also contains single quotes (aka, the "O'Malley" problem)
Quoth thy SQL? Evermore!
Solving the “O’Malley problem” with dedicated functions to sanitize our strings. Little Bobby Tables would be proud.

  • Parse(): used to extract values from a multi-value key-value string, such as a typical connection string
Part and Parse()-l
Take the Tag property and OpenArgs argument to the next level. This function makes it easy to assign and extract multiple values from a single string.

Wisdom from Around the Web

Allen Browne's ParseWord() function:

Microsoft Access tips: Parse a word from a field or phrase
VBA function to parse a word from a field or phrase in a Microsoft Access database.

Developer Humor

We’re willing to consider letting you apply!

Cover image generated by Ideogram

All original code samples by Mike Wolfe are licensed under CC BY 4.0