[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


SQL Stored Procedures - How to run from vbscript w/variables?

Posted on 2011-05-12
Medium Priority
Last Modified: 2012-05-11

This may be a relatively easy question for you guys to answer, but I'm stuck on the concept in what to do with connecting to SQL via VBScript and doing the following:

I need to have computers that run a VBScript, send a couple of variables up to a SQL Server.
I then need SQL server to run a query based off of the variable it receives from the computer.
All records that are returned in SQL need to be passed back to the original computer as VBScript variables.

I have the DB already defined with tables/views.  I don't have any stored procedures built yet.

I can't run the query on the computer itself...  Only have it send variables, and then receive replies from SQL (If this makes sense).

Is this possible?  Thanks for any information you can provide.
Question by:usslindstrom
LVL 23

Accepted Solution

OP_Zaharin earned 1000 total points
ID: 35751582
- see if this article on VBA/VBScript (ASP) invoke SQL Server stored procedure helps to get you started:

LVL 12

Assisted Solution

sachitjain earned 1000 total points
ID: 35752124
Is it VB or VB.Net??

If VB 6.0 then you could have done it through ADO command objects and in VB.Net rich set of ADO.Net objects like Adapter, Command, Dataset etc are available to fulfil these kinds of needs.

See this link for example for VB 6.0 help

Author Closing Comment

ID: 35753041
Thank you both for your assistance.

Using both those links I was able to piece together some code that was in the direction I was needing.

Much appreciated!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question