Results 1 to 5 of 5

Thread: Store Procedure Help !!!

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    44

    Store Procedure Help !!!

    Dear

    I create a store procedure such as
    CREATE PROCEDURE test @qty1 as float output
    as
    select @qty1 = sum(qty) from TestTable where TestNo = 'C01'


    Visual Basic coding:
    Private Sub Command1_Click()
    dim Tqty as Double

    Tqty=0
    Myconn.Execute "Exec Test " & Tqty

    Msgbox "Quantity = " & Tqty
    End Sub


    when i click command1 the result is 0.

    Someone can tell me what wrong with my coding?
    Long

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Because the Tqty is not being set anywhere...

    Don't you have to pass variables as parameters for Sql Server?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Because the Tqty is not being set anywhere...

    Don't you have to pass variables as parameters for Sql Server?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    44
    Dear hlynurj


    Can you give me a sample of coding how to use Store Procedure?

    I use SQL Server 2000 and Visual Basic 6.
    And to open connection i use ADO.
    Long

  5. #5
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Leavenworth KS USA
    Posts
    482

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