Need some help executing sql code from VBA. Originally I was running this code in SQL, pasting it in my excel document and just running my macro, but my manager wants to be able to do it when I'm on vacation.
native SQL code http://pastebin.com/8wL71jSC
VBA attempt http://pastebin.com/pBsQxUw6
Basically I can connect and run each query individually if I want, but when I try to run them all its not working. My guess is once I start a new rs connection the told temp table is dropped even though is should be global.
Am I fighting a loosing battle with Excel/VBA here? Should I attempt to merge my SQL query into one large query or perhaps put it into a stored procedure and call that instead?
Any help would be greatly appreciated.
Bookmarks