Information générale
Catégorie:
Applications Internet
THANK U ANYWAY VLAD
>Hi!
>
>Well, what is the error? Did you tried to examine what is in the parameters collection?
>BTW, paramneters collection indexes start from 0, so returning value will be probably in the cmd.parameters(0).value
>
>Maybe somebody else jump in and help, because this works for SQL Server. Do not know about VFPOLEDB...
>
>>Hi , something doesn't work..i got a error at the line cmd.execute
>>here is the code i'm using :
>>
>> dim conn, cmd, returnvalue
>> Set cmd = Server.CreateObject("ADODB.Command")
>> Set conn = Server.CreateObject("ADODB.Connection")
>> conn.mode = 16
>> conn.Open "Provider=VFPOLEDB.1 ; Data Source=C:\vfp\test\Mydatabase.dbc"
>> set cmd.activeconnection = conn
>> cmd.commandtype = adCmdStoredProc
>> cmd.commandtext = "myproc"
>> cmd.parameters(1) = "param"
>> cmd.execute
>> returnvalue = cmd.parameters(1)
>> RESPONSE.WRITE(RETURNVALUE)
>>
>>>Hi!
>>>
>>>In ASP you probably use ADO, so I will write this for ADO (also assuming you use VB script, not a JavaScript):
>>>
>>> Set cmdComm = New ADODB.Command
>>> Set cmdComm.ActiveConnection = objConn
>>> cmdComm.CommandType = adCmdStoredProc
>>> cmdComm.CommandText = "MySPName"
>>>
>>> ' at this moment most likely (for SQL Server OLEDB provider) Command object already will know all
>>> 'arameters and parameters collection will contain "RETURN_VALUE" parameter
>>> ' maybe add some parameters for SP here to the command obect parameters collection
>>> '...
>>>
>>> cmdComm.Execute
>>> If cmdComm.Parameters("RETURN_VALUE").Value <> 0 Then
>>> ....
>>>
>>>HTH.
>>>
>>>>How can i get the value turned back by a stored procedure using ASP ?
>>>>I can invoke it but I don't know how to get the result
>>>>
>>>>Thank u
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement