sp_OACreate, ODSOLE Extended Procedure, The system cannot find the file specified.

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Peter Vanopulos (peter_at_ibc.com.au)
Date: 11/19/04


Date: 18 Nov 2004 21:37:26 -0800

Hello,

I have been trying to resolve an issue when calling a COM component
method via the sp_OACreate stored procedure.

CREATE PROCEDURE dbo.pmpsp_Test
        @message as nvarchar(250)
 AS

-- Scratch variables used in the script
DECLARE @retVal INT
DECLARE @comHandle INT
DECLARE @errorSource VARCHAR(8000)
DECLARE @errorDescription VARCHAR(8000)
DECLARE @retString VARCHAR(100)

-- Initialize the COM component.
EXEC @retVal = sp_OACreate 'com.test.TestClass', @comHandle OUTPUT
IF (@retVal <> 0)
BEGIN
        -- Trap errors if any
        EXEC sp_OAGetErrorInfo @comHandle, @errorSource OUTPUT,
@errorDescription OUTPUT
        SELECT [Error Source] = @errorSource, [Description] =
@errorDescription
        RETURN
END

-- Call a method into the component
EXEC @retVal = sp_OAMethod @comHandle, 'HelloWorkd', @retString
OUTPUT, @param=@messageIF (@retVal <> 0)
BEGIN
        -- Trap errors if any
        EXEC sp_OAGetErrorInfo @comHandle, @errorSource OUTPUT,
@errorDescription OUTPUT
        SELECT [Error Source] = @errorSource, [Description] =
@errorDescription
        RETURN
END

-- Print the value returned from the method call
SELECT @retString

-- Release the reference to the COM object
EXEC sp_OADestroy @comHandle
GO

The following error is produced by the sp_OACreate call:

  ODSOLE Extended Procedure
  The system cannot find the file specified.
 

Since the COM component is registed by running the regasm tool over
the .net assembly I have attempted to strong name the .net assembly.
The outcome was that the sp_OACreate call worked only the first time
with subsequent calls producing the following error:

  ODSOLE Extended Procedure

This question was unresolved in a thread within
microsoft.public.sqlserver.security.
http://groups.google.com.au/groups?q=sp_OACreate+The+system+cannot+find+the+file+specified.&hl=en&lr=&selm=Xns94413DDDCCD9Yazorman%40127.0.0.1&rnum=2

Advice on resolving this issue would be much appreciated.

Thanks,

Pete



Relevant Pages

  • Re: How do I get an ASP to display a "Memo" field from Access
    ... I'm sorry I can't remember exactly how to resolve but ... as I recall we had to do something like declare the name of the memo field ... NET csgallagher AT metromilwaukee.com ...
    (microsoft.public.frontpage.programming)
  • Re: Calling function in ANALYS32.XLL
    ... Dependency Walker can resolve its functions. ... >>Private Declare Function networkdays _ ... > Are you sure it is finding the DLL? ...
    (microsoft.public.vb.general.discussion)
  • Error using Query Designer with DECLARE and date comparsion.
    ... I'm new to using MS SQL 2000. ... However two problems come up that I can't resolve at all: ... "The Query Designer does not support the DECLARE ... I do need to do a comparsion of the two dates but I don't ...
    (microsoft.public.sqlserver.programming)
  • Re: xp_sendmail attachmnents question
    ... You cannot resolve this in the xp_sendmail execution parameter. ... > declare @msg varchar ...
    (microsoft.public.sqlserver.programming)