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

Hello. My call to stored procedure sp_Tx_Del_Maint Not Working in ASP

Status
Not open for further replies.

Coder7

Programmer
Oct 29, 2002
224
US
Hello.

My stored procedure sp_Tx_Del_Maint works in query analyzer but the rows aren't being deleted when I call the sp from my asp page. I have displayed the input parameter value and it is correct. I have tried to execute working production stored procedures from my asp page and they don't work either when called from the asp so I think I have a problem with the call and need some other eyes looking at it. I'd sure appreciate any help!

<%
Sub delTxID
On Error Resume Next
Response.Write("in deltxid")
Dim retCode

Dim inPars(0)
inPars(0) = strTxID

Dim i
For i = 0 To UBound(inPars)
Response.Write("inPars(" & i & ") = " & inPars(i) & "<BR>" )
Next

retCode = objBepmDbSp.executeSp(CStr(glStrConn), "sp_Tx_Del_Maint", inPars)


Dim strError

If retCode <> 0 Then
strError = "Return code = " & retCode & " : Error in Delete.!!! "
Response.Write("<tr><td align='center'><font color='navy'>" & strError & "</font></td></tr>")
End If

If Err.number Then
strError = "Delete Error in " & Err.Source & "<BR>" & Err.number & " : " & Err.Description
Else
strError = "Tx ID Deleted Successfully"
End If
Response.Write("<tr><td align='center'><font color='navy'>" & strError & "</font></td></tr>")

End Sub 'delTxID
%>
 
I am very new to ASP, so I probably can't offer much help, however...I was told that if you are on a network then sometimes permissions/security might cause issues with SP. In order to get around this I had to prefix my stored procedures with dbo. (dbo.spSearch), otherwise they would not run. Renaming them worked for me. Hope this helps.
 
Thanks for taking the time to respond!!

I was sick last week and working to make code review deadline and not at my peak haha.

Turns out I missed defining 2 variables related to the call to the database which is why the sp didn't fire. I got someone at work to help me.

I just wasn't thinking very clearly but the upside is I learned to display err.number to get right to the issue. Be sure to comment out any ON ERROR RESUME NEXT statements.

Maybe the kindness I got here at work can be helpful to you sometime. Best of luck in your endeavors. I think web development is fun fun fun :) Have a wonderful week.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top