PDA

View Full Version : Multiple ADO recordsets allowed?


jdavidi
02-17-2009, 07:11 PM
Howdy again,

Toying more with ADO recordsets & Loop actions with v7.

I run an ADO action and this successfully adds the %RS_ADO% as expected.

I'm using Loop to process that recordset one row at a time, and then I wish to do a ton of other work with that value, including retrieving an additional ADO recordset based on the value I pulled out of the original.

Since only one %RS_ADO% macro can exist at a time, before I call the Loop action after the first ADO action, I attempted to run a Set Macro step to create a temporary RELEASES_RS_ADO macro with %RS_ADO% as the value. The new macro saves OK (displays the value as <object>, same as %RS_ADO%) but when I attempt to run the Loop action on it I get "Unexpected error occurred" and can't proceed.

My workaround (that I've been using for a while, prior to discovering the ADO action) was to use Run SQL to make a text file, format it, then read it in a line a time to a temp macro, but the ADO action would cut out a ton of that work...

Is my attempt to copy RS_ADO illegal in concept, or are there other means of creating coexising ADO recordsets?

--jdavidi

kinook
02-18-2009, 09:13 AM
An expression like %ADO_RS% will be expanded to a string value (the literal text <object> for an ADO recordset object). Use

[vbld_TempMacro("ADO_RS")]

instead to assign the underlying object reference to the macro.

Also, nested Loop actions are not currently supported.

jdavidi
02-18-2009, 09:37 AM
Thanks a mil! I'm now free of hacking text files with a dozen or so regular expression find/replaces :)