Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure which queries an AS400 Linked Server

Status
Not open for further replies.

alfredp77

Programmer
Dec 2, 2002
46
0
0
SG
Hi,

I have a stored procedure that does a query to JDE running in AS400 (I configure this as a linked server). I use OPENQUERY to execute the queries.
I execute the stored procedure from Query Analyzer there is no problem, and the execution time is really fast.

But when I execute the stored procedure through an Access database sitting on a remote PC, it hangs (running sp_who in SQL Server will show the process as "runnable" , "EXECUTE", but never finished). And after this happen, I will not be able to execute the stored procedure from Query Analyzer, it gives me the error "CoCreateInstance of MSDASQL fails" (I have to restart the machine to be able to execute the stored proc again)

When I put raiserrors on the stored proc, the errors can be captured by my Access code, which shows that it is actually executing the stored proc. And if I just use it to execute a normal stored proc (without any queries to AS400), it runs just fine.

if I use the same Access database file, and use it on the same PC as the SQL Server is installed (so the SQL Server is local), no problem.


I hope I describe the problem clear enough... not sure though whether the problem is on SQL Server or on Access.

So anyone has an idea where I went wrong?

Thanks a lot!
alfredp77
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top