Results 1 to 5 of 5

Thread: Stored Procedures

  1. #1

    Thread Starter
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    Question

    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.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    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.

  3. #3

    Thread Starter
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    Talking 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.

  4. #4
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    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.

  5. #5

    Thread Starter
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    Unhappy 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
  •  



Click Here to Expand Forum to Full Width