By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

Calling Stored Procedure from an ActiveX task

P: n/a
I'm attempting to call a storedprocedure from within an ActiveX task in
a DTS and am getting a "Command Text was not set for the command
object" error. I have no problem if I replace the stored procedure call
with the actual SQL.

Is it possible to directly call a SP via an ActiveX task? If yes, could
somebody help me with the syntax please?

This is what I have currently have

Set Conn = CreateObject("ADODB.Connection")
SQL = "exec (MySP)"
set RLoop=conn.Execute(SQL)

do while (NOT RLoop.EOF)
msgbox RLoop(1)
RLoop.MoveNext

Loop
TIA

Karthik

Jun 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Karthik (ka***********@gmail.com) writes:
I'm attempting to call a storedprocedure from within an ActiveX task in
a DTS and am getting a "Command Text was not set for the command
object" error. I have no problem if I replace the stored procedure call
with the actual SQL.

Is it possible to directly call a SP via an ActiveX task? If yes, could
somebody help me with the syntax please?

This is what I have currently have

Set Conn = CreateObject("ADODB.Connection")
SQL = "exec (MySP)"
set RLoop=conn.Execute(SQL)


Cmd = CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandType = adStoredProcedure
Cmd.CommandText = "MySP"
Set rs = cmd.Execute

Not that I have ever done it in DTS, but this should be like ADO anywhere
else.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.