Results 1 to 7 of 7

Thread: Passing a value from VB to SQL script

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Passing a value from VB to SQL script

    I assume that an SQL script running on the SQL server would be faster than running a VB app.

    So my question is how would you pass a value from a vb app to an SQL script, and then when the script is done, bring a value back to the vb app.

    Anyone have any ideas on this subject?

    Thanks
    David Wilhelm

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612
    I realize that I would have to use a stored procedure.

    My question was how do I pass a variable to this stored procedure from a vb app and vicea versa.

    Thanks!
    David Wilhelm

  3. #3
    Member
    Join Date
    Sep 2001
    Posts
    39
    That is a good way to do it.
    Use the ADO command object and fill the parameters with your values before you execute it.

    diver

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    ADO Command object

    How do you use the ADO command object? If someone could point me to a good resource on this I would appreciate it.

    Thanks!
    David Wilhelm

  5. #5
    Member
    Join Date
    Sep 2001
    Posts
    39
    Well... if you want a sample or something, then do a search on msdn. Otherwise, you might want to start a new thread asking about the ADO command object to solicit input.

    diver

  6. #6
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    Or you could search this site. The command object has been discussed several times on these boards, so I'm sure you can find something that's already been posted that will help.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  7. #7
    Member
    Join Date
    Sep 2001
    Posts
    39
    That will work... but he wants return values.
    The ADO connection object works very good with sql server to do this, and you can verify your parameter types beforehand.

    diver

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