|
-
Jan 2nd, 2001, 11:40 AM
#1
Thread Starter
Lively Member
Hi
Does anyone know how to execute a stored preocedure using VBScript in ASP. The Stored Procedure returns two values indicating whether the insert has been successfull or not. I am currently up to the following and I am now officially stuck.
Code:
Dim cnSQL
Dim ResultInt
Dim Resulttxt
'All the usual database connection stuff here
'Call the stored procedure
cnSQL = "EXEC CPSDetailsAdd_Up '12345','Hello','G Day '," _
& ResultInt & "OUTPUT," & Resulttxt & "OUTPUT"
Conn.Execute(cnSQL)
Any help would be appreciated
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
-
Jan 2nd, 2001, 11:49 AM
#2
Lively Member
i don't know if you can get a return value from a SP
this way,
but maybe to your case,
you can inspect the value in RecordsAffected to
see whether it succeeded or not.
hope it helps,
itay.
-
Jan 3rd, 2001, 08:07 AM
#3
Thread Starter
Lively Member
Records Affected
How do I inspect RecordsAffected
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
-
Jan 3rd, 2001, 08:20 AM
#4
Lively Member
syntax:
connection.Execute CommandText, RecordsAffected, Options
RecordsAffected
Optional. A Long variable to which the provider returns the number of records that the operation affected.
exmaple:
dim myvar as long
myconn.execute "SPNAME", myvar
msgbox myvar
didn't test it though,
goodluck.
itay.
-
Jan 3rd, 2001, 09:02 AM
#5
Thread Starter
Lively Member
Stored Procedure
Hi
I now have my stored procedure working without handelling returned values. I have already tried what you suggested and couldn't get it to work.
Thanks for the help anyway. I will look into it further when I have more time stress levels are at an all time peak now.
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|