Re: ADO Crash on successive calls to SQL Server
I had a similar issue once where the code altered the users environment inputs (PROD/ACCT/SYST/INTE/UNIT) into the appropriate server name (DSA/DSAA/DSAS/DSAI/DSAU).
The environment was entered byref to the code that altered it to the appropriate server name, so when it made the second call it went through the same code but never had to override say SYST to DSAS as it was already set to DSAS from the previous SQL call.
I've no idea why it was failing, or why this fixed it, but all I did was pass in a temporary copy of the environment string (i.e SYST), which was overridden to the server name, but wouldn't overwrite the original environment string, so when the second call was made it passed SYST from the input variable into the temp variable which was passed to the code to run the SQL.
EDIT: I should add that in theory changing the passing of the parameter to ByVal should have achieved the same result, but I hadn't written the SQL part of the VBA so didn't have access to alter that code directly, it was also an add-in referenced by a number of sheets so doing it this way avoided the regression testing impact that would have been inherent with changing the SQL VBA Code.
And it worked.
As I say no idea why, but if it sounds similar give it a bash.