?
Solved

Execute stored procedure in ActiveX script (vb script) in a SQL job

Posted on 2006-05-11
2
Medium Priority
?
214 Views
Last Modified: 2008-02-26
Hi,
is this the right way to run a stored procedure from ActiveX script (vb script) in a SQL job?
----------------------
Set cmdSp = CreateObject("ADODB.Command")
cmdSp.ActiveConnection = "Provider=SQLOLEDB;Server=xxx.xxx.xxx.xxx;database=dbPassetData;network=DBMSSOCN;uid=PassData;pwd=jH783Rew"
cmdSp.CommandText = "Dp_Adm_Select_MobileInfoToXml"
cmdSp.CommandType = 4
CmdSp.Parameters.Append CmdSp.CreateParameter("@C1ID", 3, 1,, 461)
CmdSp.Parameters.Append CmdSp.CreateParameter("@LID", 3, 1,, 1)
set RS = CmdSp.Execute
dim arrGuideJava: arrGuideJava = RS.GetRows()
RS.Close
set RS = nothing
set CmdSp = nothing
---------------------

/ jenmat
0
Comment
Question by:jenmat
  • 2
2 Comments
 
LVL 6

Expert Comment

by:junglerover77
ID: 16663503
set adoConn= CreateObject("ADODB.Command")
adoConn.connectionstring = "Provider=SQLOLEDB;Server=xxx.xxx.xxx.xxx;database=dbPassetData;network=DBMSSOCN;uid=PassData;pwd=jH783Rew"
adoConn.open

Set cmdSp = CreateObject("ADODB.Command")
set cmdSp.ActiveConnection = adoConn
0
 
LVL 6

Accepted Solution

by:
junglerover77 earned 2000 total points
ID: 16663512
Oh no, that's wrong. should be:

set adoConn= CreateObject("ADODB.Connection")
adoConn.connectionstring = "Provider=SQLOLEDB;Server=xxx.xxx.xxx.xxx;database=dbPassetData;network=DBMSSOCN;uid=PassData;pwd=jH783Rew"
adoConn.open

Set cmdSp = CreateObject("ADODB.Command")
set cmdSp.ActiveConnection = adoConn
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

807 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