You are here: Re: Calling Stored Procedure from an ActiveX task « MsSQL Server « IT news, forums, messages
Re: Calling Stored Procedure from an ActiveX task

Posted by Erland Sommarskog on 06/06/06 21:40

Karthik (karthiksmiles@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, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация