Re: Return a single value from a Sybase stored procedure using ADO

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Rick H" <rickh_1960@xxxxxxxxxxx> wrote in message
news:1159810680.434647.268750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have been fighting with this for a couple days.
I need to return a number from a Sybase SQLAnywhere(9) stored procedure
which has one In parameter (string) and one Out (integer).
I'm calling it from a Outlook Com addin (VB6).
I debug the SP in Sybase and it fires and sets the return value to the
proper value but I get error on the ADO call.

Error Message:

"Run Time Error '3704'"
"Operation is not allowed when the object is closed"

The error message appears at the "While Not" line

The ADO code:

Dim objConn As Object
Dim objRs As Object
Set objConn = CreateObject("ADODB.Connection")
Set objRs = CreateObject("ADODB.Recordset")
objConn.connectionString = testt
objConn.Open
objRs.Open "exec get_new_key 'appnt_key'", objConn
While Not objRs.EOF
atlnum = objRs.Fields(0)
objRs.MoveNext
Wend


Since you don't return any data set, then there is no recordset returned -
hence this error message. You'd should use Command object. It's Parameters
collection allows you to work with IN and/or OUT parameters and return
values. See ADO help for examples.

Dmitriy.


.



Relevant Pages

  • Re: Return a single value from a Sybase stored procedure using ADO
    ... proper value but I get error on the ADO call. ... The error message appears at the "While Not" line ... Dim objConn As Object ... Dim objRs As Object ...
    (microsoft.public.vb.database.ado)
  • Return a single value from a Sybase stored procedure using ADO
    ... I need to return a number from a Sybase SQLAnywherestored procedure ... The error message appears at the "While Not" line ... Dim objConn As Object ... Dim objRs As Object ...
    (microsoft.public.vb.database.ado)
  • RE: ct_connect errors in xp_cmdshell
    ... "Mike Epprecht (SQL MVP)" wrote: ... > path settings written by the Sybase setup. ... >> It is giving the following error message. ...
    (microsoft.public.sqlserver.server)
  • Re: No line number with RaiseError in DBD::Sybase
    ... error message does not indicate what line number of the program that the ... is a lot of conditional concatenating in that function, ... retcode = CS_SUCCEED; ... Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com ...
    (perl.dbi.users)
  • Re: Specify owner.objectname or use sp_helpdb
    ... I am sorry but there is no other error message. ... have tested several applications with the ODBC Driver(Original Sybase) on ... different Computers, the error is always the same, somtimes the ODBC driver ... Specify owner.objectname or use sp_help to check whether the object exists ...
    (comp.databases.sybase)