SP_OAMethod returns -2147024894

  • I am using SP_OAMethod for executing some SQL code but it returns -2147024894

    --Sample code

    declare @r int --bit

    , @rc int

    , @com int

    exec @rc = sp_OACreate 'wscript.shell', @com output;

    exec @rc = sp_OAMethod @com, 'RUN', @r output, 'OSQL -Q"select 1 " -S"SERVER1" -d"DB01" -E';

    select @rc

    select @r

    exec @rc = sp_OADestroy @com;

    The sp_OAGetErrorInfo gives null for the error description.

    I checked the odsole70.dll available and the same script works fine in another server. Please let me know where its missing. Thanks.

  • i know it's not much help, but that error number is an automation error..implying the DLL being called either does not exist or is not registered.

    http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/7c5c16d7-4029-4b6f-9a29-55a1c27718b5/

    it kind of make ssense if the DLL is not registered, that it works on some servers but not on this one, but

    can you make sur ethe DLL exists?

    i think it is "%WINDIR%\System\ and the suite of dlls is wscript.exe, wshom.ocx, wshext.dll, wshcon.dll

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I see the DLL in the BINN folder, I also the see the other dlls you mentioned in the system folder.

    When I try to register the odsole70.dll now using regsvr32 it says The module was loaded but the entry point DLLRegisterServer was not found.

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

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