SQLDMO execute a stored proc

H

hzgt9b

Using MS Access and SQLDMO (distributed management objects) I have created a
stored procedure... now I want to execute it. I have tried the following:

oDatabase.ExecuteImmediate "sp_QtrChg_Count_Tables", _
SQLDMOExec_ContinueOnError


The SP being executed has a loop that counts the number of records from a
list of table names. When I execute this SP through SQL Analyzer, it runs to
completion even if the table name in question does not exst - yes errors are
reported and that is OK. The problem is that when I execute SP via SQLDMO the
SP does not run to completion even when the "SQLDMOExec_ContinueOnError"
flag. I want the SP to execute the same as when it is executed through SQL
Analyzer - meaning after it encounters a problem I want it to ignore and keep
looping through all the table names and attempting to count them all...

I am not a liberty to change the SP - so there's no need to note the obvious
suggestion on making changes to it... what I'm really after is getting the
the SP to execute to completion - regardless of errors.

THanks for any thoughts that you have.

-Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top