I'm making use of some stored procedures to load cells within an Excel (2007) spreadsheet via macros (with VB code).
The majority of these are working fine and outputting the cell data as required (and then letting me produce charts from these).
However I've just introduced a new stored procedure and when I attempt to run this in the same way (whereby all the other stored procedures do far have worked without any problems) I get a 'Microsoft Visual Basic' error:
"Run-time error '1004':
The query did not run, or the database table could not be opened.
Check the database server or contact your database administrator.
Make sure the external database is available and hasn't been moved or reorganized, then try the operation again."
And I'm unable to generate the results of the stored procedure.
It should be noted that the same stored procedure (with the same parameters) runs without any trouble via a Query window - and produces the required result set.
As such - I'm unable to run this same procedure through to Excel - and need to!
I think the issue might be due to temporary tables within the stored procedure - with the temp tables being created and made use of in the scope of the stored procedure and then dropped at the end (of the s.p.). I've gone as far as removing the 'drop table...' statements in case they were causing the issue - but still get the same error and no result set.
If I reduce the stored procedure down to a simple result set - i.e. "select 'test return field' " - then this runs through to Excel correctly (using the same Vb code through Excel with the same parameters).
However I clearly need to get the result set as provided by the stored procedure originally written.
Has anyone come across anything similar?
And / or suggest how I can get around this problem?
Any suggestions would be greatly appreciated.
Thanks in advance.
Steve
The majority of these are working fine and outputting the cell data as required (and then letting me produce charts from these).
However I've just introduced a new stored procedure and when I attempt to run this in the same way (whereby all the other stored procedures do far have worked without any problems) I get a 'Microsoft Visual Basic' error:
"Run-time error '1004':
The query did not run, or the database table could not be opened.
Check the database server or contact your database administrator.
Make sure the external database is available and hasn't been moved or reorganized, then try the operation again."
And I'm unable to generate the results of the stored procedure.
It should be noted that the same stored procedure (with the same parameters) runs without any trouble via a Query window - and produces the required result set.
As such - I'm unable to run this same procedure through to Excel - and need to!
I think the issue might be due to temporary tables within the stored procedure - with the temp tables being created and made use of in the scope of the stored procedure and then dropped at the end (of the s.p.). I've gone as far as removing the 'drop table...' statements in case they were causing the issue - but still get the same error and no result set.
If I reduce the stored procedure down to a simple result set - i.e. "select 'test return field' " - then this runs through to Excel correctly (using the same Vb code through Excel with the same parameters).
However I clearly need to get the result set as provided by the stored procedure originally written.
Has anyone come across anything similar?
And / or suggest how I can get around this problem?
Any suggestions would be greatly appreciated.
Thanks in advance.
Steve