.Net COM Interop Class Not Working Via Sp_OACreate

Aug 2, 2006

this thread is actually to help another guy out in a seperate thread lol...I am not a COM expert but I do have a basic understanding of it from a dev perspective. I am trying to get COM interop via VS2005 to work from a sql2005 sp_OACreate call. below is the code. I can replace my custom object with say a sqldmo reference and IT WORKS! So I was thinking maybe security issues, but even when I run sql under an admin account it does not work. and i am connecting via sa for the code.

 

Also, I have tested the COM object via windows script host/.vbs file: dim oOjbect set oObject = CreateObject(myCOMObject.Math) msgbox oObject.Add(1,1). And the object appears to be listed correctly in the registry under HKEY_Classes

Imports System

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Data.SqlTypes

Imports Microsoft.SqlServer.Server

Imports Microsoft.VisualBasic

Imports System.Diagnostics

 

Public Class Math

Public Function Add(ByVal iFirstNum As Integer, ByVal iSecondNum As Integer)

Return (iFirstNum + iSecondNum)

End Function

End Class

------------------------------------------------------------------------------------------

DECLARE @object int

DECLARE @hr int

DECLARE @src varchar(255), @desc varchar(255)

EXEC @hr = sp_OACreate 'myCOMObject.Math', @object OUT,5

IF @hr <> 0

BEGIN

EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT

SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc

RETURN

END

View 6 Replies


ADVERTISEMENT

Error Working With DTS -- Class Not Registered

Jun 1, 2007

I have a DTS package (stored in a .dts file) that was created in SQL Server 2000 and I am trying to work with it in SQL 2005. When I try to import it into the Legacy > Data Transformation Services node in Management Studio, I get a window that reads "Class Not Registered (Microsoft Data Transformation Services (DTS) Package)". I get the same error if I try to just execute the package itself from a query window.



I have Legacy Support installed, and I also have Integration Services installed.



Any ideas? We have three installations of SQL 2005 and I am getting the same error on all of them.

View 1 Replies View Related

SqlDatareader Belongs To Which Class Is It Sealed Or Static Class?

Feb 21, 2008

Hai Guys,
       I have a doubt Regarding SqlDataReader
      i can able to create object to Sqlconnection,Sqlcomand etc...
     but i am unable to create object for SqlDataReader ?
     Logically i understand that SqldataReader a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited.
   sqlDatareader belongs to which class is it sealed or static class?
can we create own class like SqldataReader .......
Reply Me ...... if any one know the answer.............. 
 

View 8 Replies View Related

Can SqlDataSource Class Inherite To Another Class

Feb 1, 2008

Does any one inherit SqlDatasource class?
I treid it as :
public class MYDataSource : System.Web.UI.WebControls.SqlDataSource
{public MYDataSource(){
 
}
 
}
Debugger dont give any error or warning when i buld project. But when i use it in a page Visual studio is crashed.
 Can any one help me ?

View 1 Replies View Related

Interop.DTS In SQL 2005?

Sep 19, 2007



Been given a vbs project that uses Interop.DTS object to dynamically create a DTS package for data transfer.

Will this code work on a SQL 2005 server?

View 3 Replies View Related

ADO Interop Access Under Vista

Dec 4, 2006

I am trying to load a
project under VS2005 under Windows Vista that references an ADOX
wrapper that is looking for version 2.8.0.0. The reference fails
because the library is not registered.

I thought maybe
installing MDAC 2.8 would solve my problems, but when I run the
installer for that, it briefly puts up a dialog that it is extracting
files, then it disappears.

Anyone have any ideas?

--Bruce

View 3 Replies View Related

ADO Interop Using MDAC 2.8 On Vista

Nov 30, 2006

I am trying to load a project under VS2005 under Windows Vista that references an ADOX wrapper that is looking for version 2.8.0.0. The reference fails because the library is not registered.

I thought maybe installing MDAC 2.8 would solve my problems, but when I run the installer for that, it briefly puts up a dialog that it is extracting files, then it disappears.

Any ideas?

--Bruce

View 10 Replies View Related

SP_oacreate

Mar 31, 2008

pls send me some code samples to import a html/txt file using the sp_oacreate procedure
am getting the error number -2147221005


please let me know

View 5 Replies View Related

Office Interop Assemblies And SSIS

Apr 5, 2007

Hi guys,

I'm trying to write an SSIS script that will create an excel file and append data to it.

I downloaded the Office 2007 PIAs (Primary Interop Assemblies) and installed them on my desktop PC where i'm developing from.

However, and even though the assemblies are in the GAC, they don't appear when you look in "Add Reference" for your script task.

If i create a standard .NET web or windows app and try to "Add Reference" I can find them there.

Am I missing anything obvious?

Thanks for your help in advance

Mike

View 8 Replies View Related

Access Is Denied: 'Interop.ADODB'.

Mar 28, 2006

I am using a com component in my asp.net programme and it was working fine for many days . now I am getting following error .



Source Error:



Line 196: <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>Line 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>Line 198: <add assembly="*"/>Line 199: </assemblies>Line 200: </compilation>

Source File: c:windowsmicrosoft.netframeworkv1.1.4322Configmachine.config Line: 198

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Interop.ADODB' could not be loaded.





=== Pre-bind state information ===LOG: DisplayName = Interop.ADODB (Partial)LOG: Appbase = file:///e:/inetpub/wwwroot/SAPTRainingLOG: Initial PrivatePath = binCalling assembly : (Unknown).=== LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Post-policy reference: Interop.ADODBLOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/saptraining/8932fe97/1bed5ea1/Interop.ADODB.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/saptraining/8932fe97/1bed5ea1/Interop.ADODB/Interop.ADODB.DLL.LOG: Attempting download of new URL file:///e:/inetpub/wwwroot/SAPTRaining/bin/Interop.ADODB.DLL.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Post-policy reference: Interop.ADODB, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null





Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300


How this can be solved ? Please help

View 1 Replies View Related

Sp_OACreate With Excel

Jan 3, 2002

I'm having problems creating and saving an Excel object.

I can create a Word document, but not an Excel file

It fails and Excel is in the task manager but nothing else happens.

I have to kill the processes, from my Exe/Dll viewer "ProcExp"
(It's a cool app, that saves me from rebooting to free up my system)

Anyway, here is both my VBS and TSQL code.

TIA

JeffP...

/*
'vbs code......saved in Notepad
Dim myexcel
set myexcel = createobject("Excel.Application")
myExcel.Application.UserName = "JeffP"
myExcel.Application.Workbooks.Add
myExcel.Application.ActiveWorkbook.SaveAs ("Me.xls")
myExcel.Application.ActiveWorkbook.Save
myExcel.Workbooks.Close
myExcel.Application.Quit
'end vbs code
*/
--begin tsql
declare @Obj int ,@file varchar(100) ,@user varchar(100) ,@res int
,@sheet int ,@saveas varchar(255) ,@save varchar(255)

set @user = 'Jackx'
set @file = 'me.xls'

set @saveas = 'ActiveWorkbook.SaveAs("C:Documents and SettingsjeffMy Documents")'
set @save = 'ActiveWorkbook.Save'

exec @res = sp_oacreate 'excel.application' ,@obj output
print 'Obj'
print @res
print @obj
print '-------'

exec @res = sp_oamethod @obj ,'workbooks.add' ,@sheet output
print 'add'
print @res
print @sheet
print '-------'

exec @res = sp_oamethod @obj ,@saveas
print 'saveas'
print @res
print @file
print '-------'

exec @res = sp_oamethod @obj ,'ActiveWorkbook.Save'
print 'save'
print @res
print @file
print '-------'

exec @res = sp_oamethod @obj ,'Workbooks.Close'
print 'close'
print @res
print @file
print '-------'

exec @res = sp_oamethod @obj ,'quit'
print 'quit'
print @res
print @sheet
print '-------'

exec @res = sp_oadestroy @obj
print 'end'
print @res
--end tsql

View 1 Replies View Related

Using And Disposing Excel Interop Assembly With VB.Net In SSIS

Mar 21, 2007

What is the proper method of using the Excel.Interop assemblies with SSIS? I am using SQL Server 2005 Integration Services (VS 2005) against the .NET Framework v2.0.50727 with the Microsoft.Office.Interop.Excel.dll assembly.

I find that the referenced instance of Excel in my SSIS package is not always released from memory as expected. I'm not sure that I have a problem per se, but I am interested in knowing the Microsoft reccommended method of using the Office Interop assemblies with SSIS.

For this thread, "working" code is defined as observing the appearance and disappearance of the Excel.exe image in the Task Manager as it is created and destroyed in the SSIS package.

The following Sript Task code (between stars) works as expected in that the image of Excel can be seen created and removed from the Task Manager list of processes:

************************************************

Imports Microsoft.Office.Interop.Excel

Public Sub Main()

Dim mobjExcelApp As Microsoft.Office.Interop.Excel.Application

Dim mobjWorkbook As Microsoft.Office.Interop.Excel.Workbook

Dim objSheet as Worksheet

Dim strExcelFilename as string = "C:TempMyExcelfile.xls"

Dim strSheetname_ValidSamples as String = "Sheet1"



mobjExcelApp = New Microsoft.Office.Interop.Excel.Application

mobjExcelApp.Visible = False

mobjWorkbook = OpenWorkbook(strExcelFilename)

objSheet = CType(mobjWorkbook.Worksheets(strSheetname_ValidSamples), Worksheet)

strWell = CType(objSheet.Range("a1").Offset(intRow, 0).Value, String)

objSheet = Nothing

mobjWorkbook.close

mobjWorkbook = Nothing

mobjExcelApp.Quit

mobjExcelApp = nothing

System.GC.Collect()

System.GC.WaitForPendingFinalizers()

System.GC.Collect()

System.GC.WaitForPendingFinalizers()

End Sub

***********************

On occasion, when the line of code that sets the variable strWell (in BLUE above) is followed with the following line of code:

strSampleName = CType(objSheet.Range("a1").Offset(intRow, 1).Value, String)

the code will work fine with no errors, however, the Excel image is not removed from the task list. I have found that the instance will disappear upon waiting (several minutes or more).

Thanks,

Rob

View 5 Replies View Related

Sql Server : Sys.sp_OACreate Error

May 21, 2008

I tried to  send the html format email alert  through sql server. Its working fine in sql server 2000 (Dev Server). then i
moved to production server (sql server 2005).
when i run this email program (USP_SendHolidayAlert) in sql server 2005, i got the folloing errors,
Msg 15281, Level 16, State 1, Procedure sp_OACreate, Line 1SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is
turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole
Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface
Area Configuration" in SQL Server Books Online.
Msg 15281, Level 16, State 1, Procedure sp_OASetProperty, Line 1SQL Server blocked access to procedure 'sys.sp_OASetProperty' of component 'Ole Automation Procedures' because this component
is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole
Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface
Area Configuration" in SQL Server Books Online.
Msg 15281, Level 16, State 1, Procedure sp_OASetProperty, Line 1SQL Server blocked access to procedure 'sys.sp_OASetProperty' of component 'Ole Automation Procedures' because this component
is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole
Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface
Area Configuration" in SQL Server Books Online.
Msg 15281, Level 16, State 1, Procedure sp_OAMethod, Line 1SQL Server blocked access to procedure 'sys.sp_OAMethod' of component 'Ole Automation Procedures' because this component is
turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole
Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface
Area Configuration" in SQL Server Books Online.
Msg 15281, Level 16, State 1, Procedure sp_OADestroy, Line 1SQL Server blocked access to procedure 'sys.sp_OADestroy' of component 'Ole Automation Procedures' because this component is
turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole
Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface
Area Configuration" in SQL Server Books Online.
Stored Procedure----------------
CREATE Procedure USP_SendHolidayAlert           /*                        Name:  USP_SendHolidayAlert                     Description:  Send Email holiday Alert  Author:  Gopalan Mani                    Modification Log: Create                                            Description                  Date         Changed By                        Created procedure            13-05-2008    Gopalan Mani                    */                 @SenderName varchar(250),      @SenderAddress  varchar(250),      @RecipientName  varchar(250),      @RecipientAddress  varchar(250),      @Subject   varchar(250) ,     @Title  varchar(350)  ,    @HolidayDate   varchar(350)         as                  DECLARE @HtmlContent varchar(8000)                DECLARE @object int        DECLARE @executable int              DECLARE @RecCount int                        EXEC @executable = sp_OACreate 'CDONTS.NewMail', @object OUT        EXEC @executable = sp_OASetProperty @object, 'BodyFormat', 0        EXEC @executable = sp_OASetProperty @object, 'MailFormat', 0                       select @HtmlContent =MailText from Tbl_EmailContent where RecID=2         select @HtmlContent= REPLACE(@HtmlContent,'Holiday_Title',@Title)  select @HtmlContent= REPLACE(@HtmlContent,'Holiday_Date',@HolidayDate)      EXEC sp_OAMethod @object, 'Send', NULL,@SenderAddress ,@RecipientAddress,@Subject,@HtmlContent        EXEC sp_OADestroy @object        
please do some necessery steps to solve this problems.
 

View 2 Replies View Related

Sp_OACreate And Sp_OAMethed Heelllllpppp...

Mar 23, 2008

I have a question and I hoping to not sound to lame. I am trying to use the sp_oacreate and the sp_oamethed to run my dll from sql sever 2005
It looks some thing like this

EXEC @hr = sp_OACreate 'MyApplication.Adcom', @object OUT,5
IF @hr <> 0
BEGIN --Not able to create the object
Return @hr
END --Not able to create the object

EXEC @hr = sp_OAMethod @object, 'Authenticate', @FunctionReturn OUT, strUser, strPassword, strDoman
IF @hr <> 0
BEGIN --Not able to execute Com function
Return @hr
END --Not able to execute Com function

I have created my dll in .net and placed it in the root drive of the server. How does OACreate know where to locate my dll?
One executing this fucntion I am returning -2147221005
-214721148 error code.

Have I created my dll incorrectly? The name of the dll is ActiveDirectoryCom and the Class with in the dll is called Adcom and the function that need to run is called AuthenticateUserFullPath. Have I correctly Written the sp_Oa's

View 3 Replies View Related

Sp_OACreate And Sp_OAMethed Heelllllpppp...

Mar 23, 2008

I have a question and I hoping to not sound to lame. I am trying to use the sp_oacreate and the sp_oamethed to run my dll from sql sever 2005
It looks some thing like this

EXEC @hr = sp_OACreate 'MyApplication.Adcom', @object OUT,5
IF @hr <> 0
BEGIN --Not able to create the object
Return @hr
END --Not able to create the object

EXEC @hr = sp_OAMethod @object, 'Authenticate', @FunctionReturn OUT, strUser, strPassword, strDoman
IF @hr <> 0
BEGIN --Not able to execute Com function
Return @hr
END --Not able to execute Com function

I have created my dll in .net and placed it in the root drive of the server. How does OACreate know where to locate my dll?
One executing this fucntion I am returning -2147221005
-214721148 error code.

Have I created my dll incorrectly? The name of the dll is ActiveDirectoryCom and the Class with in the dll is called Adcom and the function that need to run is called AuthenticateUserFullPath. Have I correctly Written the sp_Oa's

View 4 Replies View Related

Need To Call Com Object Using Sp_OACreate

Apr 11, 2008

Hi,
I have com object on another machine, and I want to call from diffetent machine,Is It possible to use sp_oACreate to creating object of com object that resides on another computer.

Thanks


View 1 Replies View Related

Script Component With MS.Office.Interop.Outlook Reference

Feb 14, 2008

HiHo,
I have a problem and hopefully some can help me. I googled already al lot but I haven't found the answer.

I would like to build a Source-Script Component with Acces to MS outlook (I use the Book "SSIS" from Kirk Haselden as a Guideline).

I downloaded and installed "Microsoft.Office.Interop.Outlook" .
I can find it the GAC.

I also installed VSTO 2005 and even run the VSTO 2005 checker, which shows that everything is ok.

But when I try to add the reference to my project it isn't there.
While adding a reference I only see a ".net" tab.
From what I found so far there should be "com" tab, where I should find "MS.Office.Interop.Outlook".

Can some help me to make the reference ??

Best Regards
Chris

View 5 Replies View Related

Migrating SSIS Package Using Excel Interop To Server

Apr 28, 2008

I applied the following info and created an SSIS package that allows COM control of Excel:

unable to add reference to Microsoft Excel in VSA

The package runs locally, and can be executed successfully after it is migrated to the server, but both of these processes use local memory space (I think). When I try to run the package via a job, it fails with the following error:

-------------------------------------------------------------------------------------------

Date 4/28/2008 10:34:04 AM

Log Job History (J_MSR_UHC_PC)

Step ID 1

Server SFA30229SQL003

Job Name J_MSR_UHC_PC

Step Name S_MSR_UHC_PC

Duration 00:00:05

Sql Severity 0

Sql Message ID 0

Operator Emailed

Operator Net sent

Operator Paged

Retries Attempted 0

Message

Executed as user: ALEREsql_admin. ...on 9.00.3042.00 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 10:34:04 AM Error: 2008-04-28 10:34:06.73 Code: 0xC001405F Source: Description: Failed to decrypt an encrypted XML node because the password was not specified or not correct. Package load will attempt to continue without the encrypted information. End Error Progress: 2008-04-28 10:34:09.34 Source: Data Flow Task Validating: 0% complete End Progress Error: 2008-04-28 10:34:09.45 Code: 0xC0202009 Source: msr_uhc_pc Connection manager "Excel Connection Manager" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered". End Error Error: 2008-04-28 10:34:09.45 Code: 0xC020801C Source: Data Flow Task... The package execution fa... The step failed.

----------------------------------------------------------------------------------------------

Microsoft.Office.Interop.Excel.dll has been added to the assembly directory.

Any ideas would be appreciated.

TruckeeBill

View 4 Replies View Related

Sp_OAcreate, Access.Application Can Not OpenCurrentDatabase

Jan 19, 2007

Hi all,

trying to use MS Access Automation from within SQL Server 2000 .

Seems that OpenCurrentDatabase (Access Application property) just hangs...

Following, the code that is used:

--BOF--

--object vars
DECLARE @w_object INT,
@s_object INT

--error handling vars
DECLARE @error INT
DECLARE @src VARCHAR(255),
@desc VARCHAR(255)

--execution vars
DECLARE @command NVARCHAR(100),
@property NVARCHAR(20)

--create an Access application
EXEC @error = sp_OACreate 'Access.Application', @w_object OUT
IF @error <> 0
BEGIN
EXEC sp_OAGetErrorInfo @w_object, @src OUT, @desc OUT
SELECT CONVERT(VARBINARY(4),@error) AS Error, @src AS Source, @desc AS [Description]
RETURN
END

--get default security level
EXEC sp_OAGetProperty @w_object, 'AutomationSecurity', @property OUT
SELECT @property AS default_security_level

--set application security level to low (no sandbox)
--thought this would help, but no luck
EXEC @error = sp_OASetProperty @w_object, 'AutomationSecurity', '1' --Low Security
IF @error <> 0
BEGIN
EXEC sp_OAGetErrorInfo @w_object
GOTO Cleanup
END

--Test security level
EXEC sp_OAGetProperty @w_object, 'AutomationSecurity', @property OUT
SELECT @property AS my_security_level

--check current user
EXEC sp_OAGetProperty @w_object, 'CurrentUser', @property OUT --should be Admin
SELECT @property AS current_application_user --it is Admin

--Open non password protected database,
SET @command = 'OpenCurrentDatabase("C:mikros.mdb")'

--unfortunately this hangs...
EXEC @error = sp_OAMethod @w_object, @command
IF @error <> 0
BEGIN
EXEC sp_OAGetErrorInfo @w_object, @src OUT, @desc OUT
SELECT 'Failed to Open database', CONVERT(VARBINARY(4),@error) AS Error, @src AS Source, @desc AS [Description]
GOTO Cleanup
END

--Close current database
EXEC @error = sp_OAMethod @w_object, 'CloseCurrentDatabase'
IF @error <> 0
BEGIN
EXEC sp_OAGetErrorInfo @w_object, @src OUT, @desc OUT
SELECT 'Failed to Close database', CONVERT(VARBINARY(4),@error) AS Error, @src AS Source, @desc AS [Description]
END

Cleanup:
--close Application
EXEC @error = sp_OAMethod @w_object, 'Quit'
IF @error <> 0
BEGIN
EXEC sp_OAGetErrorInfo @w_object
END

--destroy Application Object
EXEC @error = sp_OADestroy @w_object
IF @error <> 0
BEGIN
EXEC sp_OAGetErrorInfo @w_object
END

--EOF--



Any help would be appreciated.

Thanks in advance

View 1 Replies View Related

SSIS Package Fails Giving That Com.interop Exception When Scheduled.

Apr 16, 2008



Hi,

I have one SSIS package which is written in Visual studio business intelligence tool. For that SSIS packages i have scheduled a job from SQL server management studio 2005. I mean i have scheduled a job in SQL server agent.
This job which i have scheduled contains 6 SSIS packages and the other 5 SSIS packages executes successfully but this only fails giving sone com.Interop exception.

But it is failing giving some com.interop exception. Not sure what type of error is this?

It give following type error:

Microsoft (R) SQL Server Execute Package Utility Version 9.00.3042.00 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 11:00:00 PM Error: 2008-03-27 23:00:00.81 Code: 0x00000000 Source: Execute DTS 2000 Package Task Description: System.Runtime.InteropServices.COMException (0x80040427): Execution was canceled by user. at DTS.PackageClass.Execute() at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread() End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:00:00 PM Finished: 11:00:00 PM Elapsed: 0.579 seconds. The package execution failed. The step failed.

I get the same error when i try to execute the package from Visual studio Business Intelligence tool.

Can you please help me out as to what is this "System.Runtime.InteropServices.COMException" exception occuring when scheduling or executing the job.

Thanks,
Ashok

View 1 Replies View Related

Building A Truly Platform Agnostic SSIS Package (SQL Server And Oracle Interop)

May 18, 2007

As painful as it is proving out to be, I am trying to create a single package that is vendor neutral between SQL Server and Oracle.

At first, I thought that as long as I was going OLEDB in and out, and I ensured that my SQL syntax was generic enough, I'd be OK.

Well, not exactly. I am finding there is more to this. Specifically, metadata gets generated differently based on the source/targets.

For example, on an OLE DB Source task, datatypes will vary (i.e. NUMBER in Oracle vs Int in SQL). The job here is to pick the common denominator for the SSIS specific type. Time consuming, but doable, I think.

Another issue is on an OLE DB Desitnation. If you choose Table for Data Access Mode, this value gets written to the dtsx XML file. So, even when both RDBMS have the same schema (which is an obvious prereq) if choosing SQL Server "dbo.DimTable" will get written to the file and for Oracle "SCHEMA.DIMTABLE" will get written.

So, I am am wondering, what is the best way to address this?

My inital thought was using a dtsConfig file (which I am already using extensively) and set the target table names accordingly. This approach would have the added benefit of allowing for post-deployment configuration changes should a table name change, for example.

This section of the dtsx file shows the values of interest:




Code Snippet
<component id="138" name="OLE_DST_DimTable" componentClassID="{E2568105-9550-4F71-A638-B7FE42E66922}" description="OLE DB Destination" localeId="-1" usesDispositions="true" validateExternalMetadata="True" version="4" pipelineVersion="0" contactInfo="OLE DB Destination;Microsoft Corporation;Microsoft SqlServer v9; (C) 2005 Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;4">
<properties>
<property'>http://www.microsoft.com/sql/support;4">http://www.microsoft.com/sql/support;4">
<properties>
<property id="139" name="CommandTimeout" dataType="System.Int32" state="default" isArray="false" description="The number of seconds before a command times out. A value of 0 indicates an infinite time-out." typeConverter="" UITypeEditor="" containsID="false" expressionType="None">0</property>
<property id="140" name="OpenRowset" dataType="System.String" state="default" isArray="false" description="Specifies the name of the database object used to open a rowset." typeConverter="" UITypeEditor="" containsID="false" expressionType="None">"ORASCHEMA"."DIMTABLE"</property>
<!-- More Properies -->
</component>


Ideally, I'd like configuration time control over the name attribute of the component element (highlighted) so that I can set the value of the property element with the OpenRowset attribute type (also highlighted). This way, presumambly as long as datatypes were generic enough, the mapping would just work.

But, in walking through the dtsConfig tree, I don't see these elements or attributes exposed.

I would sincerely appreciate any suggestions on how to accomplish this.

Rick

View 6 Replies View Related

EXECUTE Permission Denied On Object 'sp_OACreate', Database 'mssqlsystemresource'

Oct 5, 2006

HI There

I have a user login that is executing an sp. It gets the follwoing error:
Msg 229, Level 14, State 5, Procedure sp_OACreate, Line 1
EXECUTE permission denied on object 'sp_OACreate', database 'mssqlsystemresource', schema 'sys'.
Msg 229, Level 14, State 5, Procedure sp_OAMethod, Line 1
EXECUTE permission denied on object 'sp_OAMethod', database 'mssqlsystemresource', schema 'sys'.
Msg 229, Level 14, State 5, Procedure sp_OAMethod, Line 1
EXECUTE permission denied on object 'sp_OAMethod', database 'mssqlsystemresource', schema 'sys'.
Msg 229, Level 14, State 5, Procedure sp_OAMethod, Line 1
EXECUTE permission denied on object 'sp_OAMethod', database 'mssqlsystemresource', schema 'sys'.
Msg 229, Level 14, State 5, Procedure sp_OAGetProperty, Line 1
EXECUTE permission denied on object 'sp_OAGetProperty', database 'mssqlsystemresource', schema 'sys'.
Msg 229, Level 14, State 5, Procedure sp_OAGetProperty, Line 1
EXECUTE permission denied on object 'sp_OAGetProperty', database 'mssqlsystemresource', schema 'sys'.
Msg 229, Level 14, State 5, Procedure sp_OADestroy, Line 1
EXECUTE permission denied on object 'sp_OADestroy', database 'mssqlsystemresource', schema 'sys'.

Everything ic an find on the net refers to Sql Server 2000 but this is 2005, all the resolutions say you must grant exec permissions to the user account for these sp's in the master database.

BUT is SS2005 they are in the mysqlsystemresource database.

WHen i try the following

grant exec on mssqlsystemresource.sys.sp_OACreate to UserLogin:

I get this error:

Cannot find the object sp_OACreate, becuase the object does not exist or you do not have permission.

I am logged in as sysadmin so i doubt it is permission.

How do i get a user login to be able to exec these sp's?

Thanx

View 11 Replies View Related

Sp_OACreate In SQL Server 2005, Fails With 'Not Enough Storage Is Available To Complete This Operation'

Jan 20, 2007

Hi all,

I have created a small COM in C# so that I can programatically create and execute stored procedures with SMO. At this point the COM has nothing in it but just a test prototype.
But when I tried to create the object as follows, I get the error indicated below.
It is not a memory issue because I have adequate storage and RAM.

Please Help!

DECLARE @object int
DECLARE @hr int
DECLARE @property varchar(255)
DECLARE @return varchar(255)
DECLARE @src varchar(255), @desc varchar(255)

-- Create an object.
EXEC @hr = sp_OACreate 'SQLInterop.CsharpHelper', @object OUT
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

This is the error I am getting:

Error Code: 0x8007000E
Description: Not enough storage is available to complete this operation.
Source: ODSOLE Extended Procedure


This is the C# code for the COM:

using System;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.EnterpriseServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CSServer")]
[assembly: AssemblyDescription("Test SQL .NET interop")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("MyKey.snk")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ff35c6b4-81bf-47dd-9290-fcbbb49008d9")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

// the ApplicationName attribute specifies the name of the
// COM+ Application which will hold assembly components
[assembly: ApplicationName("SQLInterop")]

// the ApplicationActivation.ActivationOption attribute specifies
// where assembly components are loaded on activation
// Library : components run in the creator's process
// Server : components run in a system process, dllhost.exe
[assembly: ApplicationActivation(ActivationOption.Server)]
namespace SQLInterop
{
public interface ITest
{
string SayHello();
string SayIt(String strMessage);
}

//[SecurityRole("RBSecurityDemoRole", SetEveryoneAccess = true)]
[ComVisible(true)]
[CLSCompliant(false)]
[ClassInterface(ClassInterfaceType.None)]
public class CSharpHelper : ITest
{
public string SayHello()
{
return "Hello from CSharp";
}

public string SayIt(String strMessage)
{
return strMessage + ": from CSharp";
}
}
}

View 8 Replies View Related

EXECUTE Permission Denied On Object 'sp_OACreate', Database 'master', Owner 'dbo'.

Sep 21, 2005

I want to send email using sql stored procedure.my code is work fine in my local sqlserver account. when I use my online sql server it display this error.
EXECUTE permission denied on object 'sp_OACreate', database 'master', owner 'dbo'.
EXECUTE permission denied on object 'sp_OASetProperty', database 'master', owner 'dbo'.
EXECUTE permission denied on object 'sp_OAMethod', database 'master', owner 'dbo'.
EXECUTE permission denied on object 'sp_OADestroy', database 'master', owner 'dbo'.
How canI solove this problem?

View 1 Replies View Related

EXECUTE Permission Denied On Object Sp_OACreate/method/GetProperty/Destroy

Aug 3, 2002

Hi friends

I copy script that use SQL proc to call DTS package from this site.

When I run this procedure in SQL query alalyzer. I got an error messages:
EXECUTE permission denied on object sp_OACreate/method/GetProperty/Destroy.
I did not change anything in spExecutePKG.
Even I used sa as ServerPWD. How to fix this problem? my code is
exec spExecutePKG 'myserver','execl_DTS','sa','0',''
Thanks
jimmy

------proc original code
CREATE PROC spExecutePKG
@Server varchar(255),
@PkgName varchar(255), -- Package Name (Defaults to most recent version)
@ServerPWD varchar(255) = Null,-- Server Password if using SQL Security to load Package (UID is SUSER_NAME())
@IntSecurity bit = 0,-- 0 = SQL Server Security, 1 = Integrated Security
@PkgPWD varchar(255) = ''-- Package Password
AS
SET NOCOUNT ON
/*
Return Values
- 0 Successfull execution of Package
- 1 OLE Error
- 9 Failure of Package
*/
DECLARE @hr int, @ret int, @oPKG int, @Cmd varchar(1000)

-- Create a Pkg Object
EXEC @hr = sp_OACreate 'DTS.Package', @oPKG OUTPUT
IF @hr <> 0
BEGIN
PRINT '*** Create Package object failed'
EXEC sp_displayoaerrorinfo @oPKG, @hr
RETURN 1
END

-- Evaluate Security and Build LoadFromSQLServer Statement
IF @IntSecurity = 0
SET @Cmd = 'LoadFromSQLServer("' + @Server +'", "' + SUSER_SNAME() + '", "' + @ServerPWD + '", 0, "' + @PkgPWD + '", , , "' + @PkgName + '")'
ELSE
SET @Cmd = 'LoadFromSQLServer("' + @Server +'", "", "", 256, "' + @PkgPWD + '", , , "' + @PkgName + '")'

EXEC @hr = sp_OAMethod @oPKG, @Cmd, NULL

IF @hr <> 0
BEGIN
PRINT '*** LoadFromSQLServer failed'
EXEC sp_displayoaerrorinfo @oPKG , @hr
RETURN 1
END

-- Execute Pkg
EXEC @hr = sp_OAMethod @oPKG, 'Execute'
IF @hr <> 0
BEGIN
PRINT '*** Execute failed'
EXEC sp_displayoaerrorinfo @oPKG , @hr
RETURN 1
END

-- Check Pkg Errors
EXEC @ret=spDisplayPkgErrors @oPKG

-- Unitialize the Pkg
EXEC @hr = sp_OAMethod @oPKG, 'UnInitialize'
IF @hr <> 0
BEGIN
PRINT '*** UnInitialize failed'
EXEC sp_displayoaerrorinfo @oPKG , @hr
RETURN 1
END

-- Clean Up
EXEC @hr = sp_OADestroy @oPKG
IF @hr <> 0
BEGIN
EXEC sp_displayoaerrorinfo @oPKG , @hr
RETURN 1
END

RETURN @ret
GO

View 1 Replies View Related

EXECUTE Permission Denied On Object 'sp_OACreate', Database 'master', Owner 'dbo'.

Sep 21, 2005

I want to send email using sql stored procedure.my code is work fine in my local sqlserver account. when I use my online sql server it display this error.

EXECUTE permission denied on object 'sp_OACreate', database 'master', owner 'dbo'.

EXECUTE permission denied on object 'sp_OASetProperty', database 'master', owner 'dbo'.

EXECUTE permission denied on object 'sp_OAMethod', database 'master', owner 'dbo'.

EXECUTE permission denied on object 'sp_OADestroy', database 'master', owner 'dbo'.

How canI solove this problem?

View 2 Replies View Related

Sp_OACreate 'SQLXMLBulkLoad.SQLXMLBulkload' In 2005

Jan 31, 2006

With my Sql server I install SQLxml3.0 and run this with problem.
DECLARE @ObjectError INT
, @Object INT
, @ErrMsg VARCHAR(50)

EXEC @ObjectError = sp_OACreate 'SQLXMLBulkLoad.SQLXMLBulkload', @Object OUT,4I plan to go with the Sql server 2005 but this code give me a error...:eek: Msg 15281, Level 16, State 1, Procedure sp_OACreate, Line 1

SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface Area Configuration" in SQL Server Books Online.
My user right not change. And I dont see some "SQLXML" in the "Surface Area Configuration"???

Can someone can give my suggestion?

View 1 Replies View Related

Some Things Not Working In 2005 And Working In 2000

Mar 3, 2006

hi

I had a view in which I did something like this
isnull(fld,val) as 'alias'

when I assign a value to this in the client (vb 6.0) it works ok in sql2000 but fails in 2005.
When I change the query to fld as 'alias' then it works ok in sql 2005 .
why ?? I still have sql 2000 (8.0) compatability.

Also some queries which are pretty badly written run on sql 2000 but dont run at all in sql 2005 ???

any clues or answers ?? it is some configuration issue ?

Thanks in advance.

View 5 Replies View Related

SQL 2K5 Class

Oct 6, 2006

Does anybody know of a good facility to take a SQL 2000 to SQL 2005 Admin course that is geared towards experienced DBAs, that is not so costly. I'm not the type that can sit and read on my own to learn, it has to be a real project or a classroom environment.

Also, the NYC area.

thanks,
Paul

View 1 Replies View Related

SQL Class

May 8, 2008

Just started SQL Class and I am struggling with an assignment.
Would someone be kind to give me some help please?

your task is to make a stored procedure that will only billcustomers making monthly payments higher than $500.A Customer can have multiple Plans (services for which they pay amonthly fee).

You have to execute a billing procedure for each single active planunder an eligible customer account. Eligible customer account is anaccount that makes estimated monthly payment higher than $500.

You are given 2 tables, "Customers" and "Plans". Table "Customers" has columns: CustomerID, EmailAddressTable "Plans" has columns: PlanID, CustomerID, MonthlyPrice, isClosed,NextBillDate

Also, you are given two stored procedures named "Bill_Plan" and"Send_Email". All stored procedures returns 0 upon success and negativenumber upon failure.The "Bill_Plan" actually bills a customer for a plan. The storedprocedure takes one input parameter and have one output parameter.

Bill_Plan
@nPlanID = @PlanID,
@dtNewBillDate = @NextBillDate output

You have to use the output parameter @NextBillDate to updatePlans.NextBillDate with its new value.

Upon successful billing you have to send en email to the customer'semail address. The "Send_Email" stored procedure takes two inputparameters.
Send_Email
@sEmailAddress = @EmailAddress,
@sSubject = 'Your Invoice is Ready'
You have to rollback any single billing transaction upon any kind offailure and continue billing the remaining plans. (Important!!!)


Thank signed I don't want to flunk!

View 6 Replies View Related

Save Class

Feb 27, 2007

Hello,I created a class in my .Net code and I have an SQL 2005 table with a column of type image (I suppose I should use this type)After I define the class properties I need create a new record and save the class in the database.Can I do it the same way as I would save, for example, a string in a varchar field?Thanks,Miguel 

View 1 Replies View Related

Calling A SP In A Class

Jan 17, 2008

Hello,
I have the class below. And trying to execute it on a button click event.
What am i doing wrong ?
Thanks
Here is the button click event1 protected void Button1_Click(object sender, EventArgs e)
2 {
3 signup_data_entry signup = new signup_data_entry();
4 signup.signup_data_entry();
5
6 }

  
Here is my class file. please advice
 1 public class signup_data_entry
2 {
3 public signup_data_entry()
4 {
5 //SqlConnection con = new SqlConnection("cellulant_ConnectionString");
6 SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["cellulant_ConnectionString"]);
7
8 SqlCommand command = new SqlCommand("Cellulant_Users_registration", con);
9 command.CommandType = CommandType.StoredProcedure;
10
11 con.Open();
12
13 //string IP = new string();
14
15
16 command.Parameters.Add(new SqlParameter("@RegionID", SqlDbType.Int, 0, "RegionID"));
17 command.Parameters.Add(new SqlParameter("@RegionDescription", SqlDbType.NChar, 50, "RegionDescription"));
18
19 command.Parameters[0].Value = 4;
20 command.Parameters[1].Value = "SouthEast";
21
22 int i = command.ExecuteNonQuery();
23
24
25 }
26 }

 

View 6 Replies View Related

How To Make Class

Jan 25, 2008

hiiiiiiiiii    I am creating a web application using vb.net  in which i m using the concept of classes. now i am done all the code for inserting the values in the database using the class but it is difficult to fetch the values from the database using select command and sending them to a WebForm  . i want to know how i send send the values coming from the select command to a datagrid or another web controlif possible provide me a sample code  thanks for your help

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved