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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Stored Proc Problem

Status
Not open for further replies.

anyideas

Programmer
May 2, 2002
127
GB
Hi all.

I have an MSSQL stored Procedure which works when I access it from Query Analyzer but not from ASP.

The stored Proc has one value passed to it

Any help really appreciated!

Mark

The line in query analyzer is:


execute op_CSInsertCustomerCall 100


The code for my asp file is:


<%@ Language=VBScript %>

<%

Dim dbConn
Dim strSQL
Dim username

Set dbConn = Server.CreateObject(&quot;ADODB.Connection&quot;)

'Connect to the database
dbConn.ConnectionString = Application(&quot;CustomerServices_ConnectionString&quot;)
dbConn.ConnectionTimeout = Application(&quot;CustomerServices_ConnectionTimeout&quot;)
dbConn.Open

dbConn.Execute &quot;EXEC op_CSInsertCustomerCall 100&quot;

%>

<HTML>
<HEAD>
</HEAD>
<BODY>

<SCRIPT>

window.close()

</SCRIPT>

</BODY>
</HTML>
 
What (if any) errors are returned?

dbConn.Execute &quot;EXEC op_CSInsertCustomerCall 100&quot;
dim obj_Error
for each obj_Error in dbConn.Errors
Response.write obj_Error.Description & &quot;<br><br>&quot;
next codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Thanks for responding codestorm

The browser just says

Page cannot be displayed

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Error Type:
(0x80040E09)
/customerservices/datawrites/writeCallMade.asp, line 62
 
..and what happens on line 62? codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
dbConn.Execute &quot;EXEC op_CSInsertCustomerCall 100&quot;

I don't know if this helps...

I asked the browser for dbconn state and it returned 1


 
Sorry, I have to go to sleep, but my first suggestion is to use Command and Parameter objects (see ado210.chm or similar) codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Sorted it out-

The permissions of the stored procedure weren't set to EXEC for the user logged one

Thanks for trying

Mark
 
BTW, you should have gotten a more meaningful error in that case .. check that ou browser has user friendly error messages turned off. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top