Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call stored procedure from vbscript 1

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
I have a vbscript that loops through bunch of records, reformats them and loads them into a SQL Server table. It works very nicely. Now I need to fire off a stored procedure right after I hit EOF on the record loading.
However, before I add it to the existing script, I'd like to try firing it off all by itself. The SP doesn't take any parameters and doesn't return any records.

After checking various threads on calling SPs from VBS that I got using the search function, and responding to various error messages, I've come up with:


set server = "10.60.84.61"
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=SQLOLEDB.1; (from existing vbs)
set cmd = Server.CreateObject("ADODB.Command")

with cmd
.activeConnection = objconnection
.commandtext = "exec SPName"
end with

cmd.execute

Now the error message is:
Line 1
Char 1
Error: Object Required: '[String "10.60.84.61"]'

What do I need in VBS to just up and fire off an SP?

 
server is a string, not an object, so use this:
server = "10.60.84.61"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top