Wednesday, March 7, 2012

Recordset destination used in a FOREACH?

Hi all,

Can a Recordset destination be used as source for a ForEach loop.

Correct me if i'm wrong but the Recordset is stored in a variable of type Object? So what stops my ForEach loop from itterating?

Regards,

Pieter

Well, there are about 70-80 examples of using a recordset as a foreach enumerator (source) between BOL, google groups, and this MSDN forum. Shorter answer, yes.

Here's a good example from Jamie Thompson, http://blogs.conchango.com/jamiethomson/archive/2005/07/04/1748.aspx, which not only has verbiage, but a .dtsx file as well.

|||Thanks for the reply. After my post i tried a test project and it worked 100%. I then tried again in my actual project and no luck. Since then I rebuilt my entire work project around the test project and it is still working....go figure

No comments:

Post a Comment