Running SP

I

Inge Buller

Hi!

When I right-click on a SP in a adp, I can run the SP. Any errors coming
from a RAISERROR in the SP will be shown in a messagebox.

How can I get the same behaviour when I run the SP from a button on a form?

This is the code I´m using:

DoCmd.OpenStoredProcedure "MySP", acViewPreview, acReadOnly

This way I´m not getting any error info in Acces, I only see an OLE-object
error.

Anyone kows how I can get to the error? The whole idea is to use Access as a
"test GUI", so i am NOT interested in using ADO code explicitly (saving that
for the real GUI...).

Thx,
 
S

Sylvain Lafontaine

The DoCmd.OpenStoredProcedure is some sort of evolutive climbing from the
past and is limited in its fonctionality, like much of the other macros. I
don't even know if you can use with parameters.

For a test GUI, you should use the Query Analyser instead, somewhat more
powerful and with a small debugger.

S. L.
 
I

Inge Buller

I've been using QA since it was introduced, and I do all my "real"
development there. Maybe I was unclear when I called it a "test GUI".



What I mean is more of a "prototype GUI", something I can show the client.
That pretty much disqualifies QA, but Access is perfect. I can create some
forms, add some buttons to call SP:s and it sort of LOOKS as an application.
Perfect for discussing workflow, business logic and so on. All created in
minutes.



Only problem is I can't get down to the SQL errors.
 
S

Sylvain Lafontaine

Then perhaps creating your own VBA procedure for calling stored procedure
would be your ticket?

I remember that there was such a procedure, with full support for
displaying result, in Access 97 Developer's Handbook from Litwin, Getz and
Gunderloy. (Something called the SQL Scratchpad). There are also editions
for this book for Access 2000 and 2002. If I remember correctly, this
procedure was doing exactly what you want.

S. L.
 

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