Showing posts with label activex. Show all posts
Showing posts with label activex. Show all posts

Thursday, March 22, 2012

Error: -2147024770 when i scheduled a package containing a custom task

I create a VB ActiveX DLL custom task, when i execute the package containing the DLL custom task, all is ok
But when i scheduled the package i receive the message "Error: -2147024770 The specified module could not be found"
In the code of the VB custom task i use the sysdtssteplog table from MSDB and it doesn't log anything
What's the problem
Thanks!Whenever I seen that error from VB - SQL it has always
been in the context that the SQL command run from VB has
not worked.
Try a trace to see exactly what SQL was processed.
J
>--Original Message--
>I create a VB ActiveX DLL custom task, when i execute the
package containing the DLL custom task, all is ok.
>But when i scheduled the package i receive the
message "Error: -2147024770 The specified module could
not be found".
>In the code of the VB custom task i use the sysdtssteplog
table from MSDB and it doesn't log anything.
>What's the problem?
>Thanks!
>.
>|||Jay,
When you run it, what context (login, machine, etc) are you running under?
When you schedule it (I assume through SQL Agent), what context (login,
machine, etc) are you running under?
I suspect that the SQL Server account (either the account running the SQL
Server service or the SQL Agent proxy account) does not have rights to the
location where the DLL is stored. Make sure that the DLL can be reached by
the SQL Server.
Russell Fields
"JayF" <anonymous@.discussions.microsoft.com> wrote in message
news:025B1AE0-EDC9-482C-B93E-788775D19D24@.microsoft.com...
> I create a VB ActiveX DLL custom task, when i execute the package
containing the DLL custom task, all is ok.
> But when i scheduled the package i receive the message
Error: -2147024770 The specified module could not be found".
> In the code of the VB custom task i use the sysdtssteplog table from MSDB
and it doesn't log anything.
> What's the problem?
> Thanks!

Error: -2147024770 when i scheduled a package containing a custom task

I create a VB ActiveX DLL custom task, when i execute the package containing
the DLL custom task, all is ok.
But when i scheduled the package i receive the message "Error: -2147024770
The specified module could not be found".
In the code of the VB custom task i use the sysdtssteplog table from MSDB an
d it doesn't log anything.
What's the problem?
Thanks!Jay,
When you run it, what context (login, machine, etc) are you running under?
When you schedule it (I assume through SQL Agent), what context (login,
machine, etc) are you running under?
I suspect that the SQL Server account (either the account running the SQL
Server service or the SQL Agent proxy account) does not have rights to the
location where the DLL is stored. Make sure that the DLL can be reached by
the SQL Server.
Russell Fields
"JayF" <anonymous@.discussions.microsoft.com> wrote in message
news:025B1AE0-EDC9-482C-B93E-788775D19D24@.microsoft.com...
quote:

> I create a VB ActiveX DLL custom task, when i execute the package

containing the DLL custom task, all is ok.
quote:

> But when i scheduled the package i receive the message

Error: -2147024770 The specified module could not be found".
quote:

> In the code of the VB custom task i use the sysdtssteplog table from MSDB

and it doesn't log anything.
quote:

> What's the problem?
> Thanks!
sql

Sunday, March 11, 2012

ERROR: "activex component can't create object: 'excel.application'"

When I run a DTS, I get the following error.
Error I get: "activex component can't create object:
'excel.application'"
I was told not to load excel into sql server. Well, in any case, there
should not be any need to load excel, it recognizes the excel component
in the DTS, that means, it should be recognizing excel.
Please assist.
Thx,
Swim.
'***************************************
*******************************
' Visual Basic Transformation Script
'***************************************
*********************************
Function Main()
' Initialise dimensions
Dim appExcel
Dim newBook
Dim oSheet
Dim oPackage
Dim oConn
'Set excel objects
Set appExcel = CreateObject("Excel.Application")
Set newBook = appExcel.Workbooks.Add
Set oSheet = newBook.Worksheets(1)
' Populate heading columns for mapping purposes and display in excel
oSheet.Range("A1").Value = "Col1"
oSheet.Range("B1").Value = "Col2"
oSheet.Range("C1").Value = "Col3"
oSheet.Range("D1").Value = "Col4"
'Dynamically specify the name of the new Excel file to be created and
exported to
DTSGlobalVariables("fileName").Value = "C:\Rpts\cc\a.xls"
'" & DTSGlobalVariables("gvID").value & ".xls"
With newBook
.SaveAs DTSGlobalVariables("fileName").Value
.save
End With
appExcel.quit
set oPackage = DTSGlobalVariables.parent
'connection 2 is to the Excel file
set oConn = oPackage.connections(2)
oConn.datasource = DTSGlobalVariables("fileName").Value
'Destroy objects
set oPackage = nothing
set oConn = nothing
Main = DTSTaskExecResult_Success 'End on success
End FunctionIs your DTS package just exporting to or import from Excel or is it
instantiating Excel from a VBScript task?
"Swim" <crombusch@.gmail.com> wrote in message
news:1134093275.263026.230460@.g44g2000cwa.googlegroups.com...
> When I run a DTS, I get the following error.
> Error I get: "activex component can't create object:
> 'excel.application'"
> I was told not to load excel into sql server. Well, in any case, there
> should not be any need to load excel, it recognizes the excel component
> in the DTS, that means, it should be recognizing excel.
> Please assist.
> Thx,
> Swim.
>
>
>
>
> '***************************************
*******************************
> ' Visual Basic Transformation Script
> '***************************************
*********************************
> Function Main()
> ' Initialise dimensions
> Dim appExcel
> Dim newBook
> Dim oSheet
> Dim oPackage
> Dim oConn
> 'Set excel objects
> Set appExcel = CreateObject("Excel.Application")
> Set newBook = appExcel.Workbooks.Add
> Set oSheet = newBook.Worksheets(1)
> ' Populate heading columns for mapping purposes and display in excel
> oSheet.Range("A1").Value = "Col1"
> oSheet.Range("B1").Value = "Col2"
> oSheet.Range("C1").Value = "Col3"
> oSheet.Range("D1").Value = "Col4"
>
> 'Dynamically specify the name of the new Excel file to be created and
> exported to
> DTSGlobalVariables("fileName").Value = "C:\Rpts\cc\a.xls"
> '" & DTSGlobalVariables("gvID").value & ".xls"
> With newBook
> .SaveAs DTSGlobalVariables("fileName").Value
> .save
> End With
> appExcel.quit
> set oPackage = DTSGlobalVariables.parent
> 'connection 2 is to the Excel file
> set oConn = oPackage.connections(2)
> oConn.datasource = DTSGlobalVariables("fileName").Value
> 'Destroy objects
> set oPackage = nothing
> set oConn = nothing
> Main = DTSTaskExecResult_Success 'End on success
> End Function
>

Sunday, February 19, 2012

Error while registering assembly that uses ActiveX wrapper stdole

> Hi,
>
> I wrote a dummy Stored Procedure in C#, registered it as assembly,
> called the SP and everthing was fine (VS2005 C# Express)
> Then I implemeted functionality into the dummy SP that requires a
> third party ActiveX. It is integrated in my project by the reference
> to "stdole". After compiling, I got three DLL:
>
> a.dll - with the dummy SP (compiled with strong name)
> b.dll - the third party OCX
> stdole.dll - system
>
> Now, I have problems registering that stuff. a requires b. b requires
> c. and c registration is not possible due to that error:
>
>
> Create failed for SqlAssembly 'stdole'. (Microsoft.SqlServer.Smo)
>
> ADDITIONAL INFORMATION:
>
> An exception occurred while executing a Transact-SQL statement or
> batch. (Microsoft.SqlServer.ConnectionInfo)
>
>
>
> CREATE ASSEMBLY failed because method 'Next' on type
> 'stdole.IEnumVARIANT' in safe assembly 'stdole' has invalid attribute
> 0x1003.
> Warning: The Microsoft .Net frameworks assembly 'stdole,
> version=7.0.3300.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.'
> you are registering is not fully tested in SQL Server hosted environment.
> Warning: Assembly "stdole" was built using version v1.0.3705 of the
> .NET Framework. SQL Server currently uses version v2.0.50727.
> (Microsoft SQL Server, Error: 6215)
>
> What can I do to register my a assembly for SQL Server 2005? Wrong
> compiler setting? How can I make the systems stdole.dll known as an
> assembly in SQL Server 2005?
>
> Thanks for help + regards,
>
> Christian

Safe

Select this option to use this permission set for the assembly reference. If this option is selected, the assembly is allowed only internal computation and local data access. Code executed by an assembly with this option cannot access external system resources such as files, the network, environment variables, or the registry.

Security Note This option is the recommended permission setting for assemblies that perform computation and data management tasks without accessing resources outside Analysis Services. This option represents the most restrictive permission set.

External access

Select this option to use this permission set for the assembly reference. If this option is selected, the assembly is allowed only internal computation and local data access. Code executed by an assembly with this permission set has the ability to access external system resources such as files, networks, environmental variables, and the registry.

Security Note This option is recommended for assemblies that access resources outside Analysis Services. Assemblies using this option, by default, execute using the security credentials of the service account. It is possible for code within this assembly to explicitly impersonate the caller’s Microsoft Windows Authentication security context. Because the default is to execute as the service account, permission to execute assemblies with this option should only be given to roles trusted to run as the service account. This option represents a less restrictive permission set than Safe, but more restrictive than Unrestricted.

Unrestricted

Select this option to use this permission set for the assembly reference. If this option is selected, the assembly has unrestricted access to resources, both inside and outside. Code executing from within an assembly with this option can call unmanaged code.

Security Note This option is not recommended unless the assembly requires unrestricted access. From a security perspective, this option is identical to External access. However, assemblies using the External access option provide various reliability and robustness protections that are not included in assemblies using this option. Specifying this option allows the code in the assembly to perform illegal operations against the process space and hence can potentially compromise the robustness and scalability of Analysis Services. This option represents the least restrictive permission set, and should be used with caution.


I got this from msdn2

Have you tried registering the assembly with one of the above switches?

It also looks as though the stdole you are using is out of date, perhaps from a previous install.|||Hi Simon,
thanks for your answer. Yes, I tried all that stuff, but it doesn't work. I even generated a strong name for my assembly. No effect.
I saw that message concerning the version info of stdole, but the strange thing is that VS C# 2005 Express Edition copied that version in my target build folder automatically. So, I assume, it's the correct stdole version ... if not: do you have an idea how I get the correct version?
Thanks + regards,
Christian
|||The problem you have is that you need to create the stdole assembly with a permision set of (I believe) UNSAFE. In order to do that you need to set some additional security details on the database, and there are a couple of ways to do that. The easiest is probably to:
1. Grant the login of the database owner the UNSAFE ASSMBLY permission.
2. Mark the database as trustworthy

Now you should be able to create the assembly with unsafe.

Niels