Friday, May 14, 2004

Iterating Items collections in VBScript - why items don't behave

Here's an interesting Microsoft knowledge base article I stumbled across that discusses a common mistake on iterating an Item collection.. The premise is that any property/method on a given Item in the collection always references the collection's Item directly: be sure to use a single reference instead of referencing the Item multiple times.

Wednesday, May 12, 2004

SQL Server sp_OAGetProperty iterating files collection

So I'll start off actually with a question:
Using SQL Server stored proc sp_OAGetProperty, how can I iterate a file directory to manipulate each file one by one? Currently, I've gotten as far as getting the files collection, but I can't seem to get the sp_OAGetProperty to use Files.Item in any subscripting/indexed way. All FileSystemObject examples use a foreach, which, of course, is not available using sp_OAGetProperty or sp_OAMethod.