Are you replying to me? Please quote some of the message to which you are
replying.
amitavabardhan wrote:
Yes, but how do I return an error message/ code from a sql server
stored procedure to an asp page?
Again, errors are returned automatically to the ADO Connection, which
automatically bubbles them up to the vbscript runtime, which creates an Err
object containing the information, which you can trap using "On Error Resume
Next".
On Error Resume Next
connection.Stor edProcedureName parm1,..,parmN
If err <> 0 then
'handle the error
errmsg= err.description
'optionally, check the connection's Errors collection:
if connection.Erro rs.Count > 0 then
for i = 0 to connection.Erro rs.Count - 1
errmsg=connecti on.Errors(i).De scription
'etc.
next
end if
end if
The reason for checking the Errors collection is that in some cases,
multiple errors may be returned from the procedure. Only the first error
gets bubbled up to the vbscript runtime. The rest will be found in the
connection's errors collection.
Here is a link to the download location for the vbscript documentation:
http://tinyurl.com/7rk6
You can read the ADO documentation online at:
http://msdn.microsoft.com/library/en...dooverview.asp
Here is some more information about executing stored procedures from ASP:
http://tinyurl.com/jyy0
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"