Scheduled Job is not creating dll object in sql server 2008

  • Hi,

    I have created one dll in vb6. i have registered that dll on the server. The Server is 64 bit. Then i have scheduled job on the server 2008. The t-sql script is as follows.

    DECLARE @cInputValue1 int

    DECLARE @cInputValue2 int

    DECLARE @cOutputValue int

    DECLARE @objDLL int

    declare @Hresult int

    DECLARE @ErrorSource varchar (255)

    DECLARE @ErrorDesc varchar (255)

    SET @cInputValue1 = 5

    SET @cInputValue2 = 6

    EXECUTE @Hresult =sp_OACreate "CreditsExpiring.clsCreditsExpiringUsers", @objDLL OUTPUT

    -- objDLL holds a handle to your DLL

    --EXECUTE @Hresult =sp_OAMethod @objDLL, "Send_Newsletter"

    print @cOutputValue

    -- Don't forget to release it when you have finished

    EXECUTE @Hresult =sp_OADestroy @objDLL

    IF @Hresult <> 0

    BEGIN

    EXEC sp_OAGetErrorInfo @objDLL , @ErrorSource OUT, @ErrorDesc OUT

    PRINT 'Error Occurred Calling Object: ' + @ErrorSource + ' ' + @ErrorDesc

    RETURN

    END

    When i try to run the job, it seems that it runs. but when i look into the job history i see the following error.

    ODSOLE ExtendedProcedure sp_OADestroy usage: ObjPointerToBeDestroyed int IN.[SQLSTATE 01000](Message 0)

    Could you please have some suggestion around this and what may be the cause. To check my dll code i ran it on other server and it works there. But not on this new 64 bit server.

    Thanks in advance for help.

  • Use corflags.exe at the command line to see if it an .exe or .dll is meant to run only on a specific platform or under WOW64. You can also use corflags.exe to change the platform status of an .exe or .dll. See CorFlags Conversion Tool (CorFlags.exe) for more information. A Visual Studio assembly's CLR header (or COM+ Runtime header) has the Major Run-time Version Number set to 2 and the Minor Run-time Version Number set to 5. In Visual Studio 2003 assemblies, they are 2 and 0, respectively. All applications that have the minor runtime version set to 0 are treated as legacy applications and are always executed under WOW64 on 64-bit machines.

    Alex S

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply