The Weird and The Wonderful
The Weird and The Wonderful forum is a place to post Coding Horrors,
Worst Practices, and the occasional flash of brilliance.
We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid
workarounds and developers just not quite getting it. And then somedays we come across - or write -
the truly sublime.
Post your Best, your worst, and your most interesting. But please - no
programming questions . This forum is purely for amusement and discussions on code snippets. All
actual programming questions will be removed.
|VB6 and earlier needed
Let because of non-indexed default properties, which thankfully went away when .NET was first released.
Dim rst As ADODB.Recordset
Set rst = ...
Dim foo As Variant
foo = rst["Bar"]
Recordset class doesn't have an indexer, but it has a default property called
Fields which does.
- The indexer returns an
ADODB.Field object, with a non-indexed default property called
- At this point, the compiler wouldn't know whether you want the variable to contain the field object or the field's value.
- Therefore you have to use
Set if you want the field object, and
Let (or nothing) if you want the value.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.