how to use ASP reference a stored procedure in Sybase database?

how to use ASP reference a stored procedure in Sybase database?

Post by ?à2? » Sat, 24 Jul 1999 04:00:00



how to use asp reference a stored procedure in Sybase database?
its a simple select clause with parameters.

and i find in VB6's dataenvironment(ADO) a sybase stored procedure can't be
treated as a recordset but if its a simple select clause with parameters in
MSSQL, dataenvironment will expand the command with outputs......

is it the difference of stored procedure between Sybase and MSSQL?

--


ICQ UIN: 31928674

--


ICQ UIN: 31928674

 
 
 

1. Retrive output parameters when using stored procedure in Sybase database

Hello

I hope someone can help me.

I'm using Visual Basic and ADODB to connect to my Sybase database. When I execute
stored procedure which returns both a resultset and output parameters, I don't
get the output parameters. I put a code example here, and my problem here is
that 'orec' and 'omsg' doesn't get any value:

Dim cnDatabase As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs3 As New ADODB.Recordset
Private Sub my()
    Dim param1 As Parameter, param2 As Parameter, param3 As Parameter
    Dim orec as integer, imsgid as integer, imsgtype as integer
    Dim omsg as string
  With cnDatabase
   .Open "DATABASE=" & "myDB" & ";UID=" & "user" & ";PWD=" & "psw" & ";DSN="
& "myDSN"
   .CursorLocation = adUseServer

   Set param1 = .CreateParameter("Sessionid", adInteger, adParamInput, , 22)
   Set param2 = cmd.CreateParameter("message", adVarChar, adParamOutput, 254)
   Set param3 = cmd.CreateParameter("returncode", adInteger, adParamOutput)

   cmd.ActiveConnection = cnDatabase
   cmd.CommandText = "ssp_msg_id"
   cmd.CommandType = adCmdStoredProc
        cmd.Parameters.Append param1
        cmd.Parameters.Append param2
        cmd.Parameters.Append param3
    Set rs3 = cmd.Execute
    imsgid = rs3.Fields("msgId")
    imsgtype = rs3.Fields("msgTypeId")
    rs3.Close
    omsg = cmd(1)
    orec = cmd(2)
  End With
End Sub

Thanks!!! :-)

Vigdis

2. Howto call a stored procedure and get a return value

3. Calling Stored Procedure that calls Stored Procedure in ASP

4. Code to upload and download pictures.

5. Executing stored procedures on Sybase from ASP

6. NC-WINSTON-115018--C-RDB-AIX- Programmer / Analyst (AIX)

7. unexpected conditions and paradox dos under 95

8. Using Stored Procedure to execute DTS package from ASP page

9. Adding NUL to DBL using ASP/Stored Procedures

10. Manual change View/Stored Procedure detail using ASP

11. SQL Stored Procedure using more than 1 SELECT in ASP

12. SQL XML Stored Procedure using XML Explicit Returing XML to ASP Page