0x80028019 - Old format or invalid type library.

  • Hi Guys,

    I have the following stored proc. When i run this proc on one of our servers, we get this error:

    0x80028019 - ODSOLE Extended Procedure - Old format or invalid type library.

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_NULLS ON

    GO

    Create  PROCEDURE sp__DiskSpace

    as

    SET NOCOUNT ON 

     

    DECLARE @hr int 

    DECLARE @fso int 

    DECLARE @drive char(1) 

    DECLARE @odrive int 

    DECLARE @TotalSize varchar(20) 

    DECLARE @MB bigint ; SET @MB = 1048576 

    DECLARE @GB bigint ; SET @GB = 1024

     

    INSERT drivesspace(drive,FreeSpace)  

    EXEC master.dbo.xp_fixeddrives 

     

    EXEC @hr=sp_OACreate 'Scripting.FileSystemObject',@fso OUT 

    IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso 

     

    DECLARE dcur CURSOR LOCAL FAST_FORWARD 

    FOR SELECT drive from drivesspace 

    ORDER by drive 

     

    OPEN dcur 

     

    FETCH NEXT FROM dcur INTO @drive 

     

    WHILE @@FETCH_STATUS=0 

    BEGIN 

     

            EXEC @hr = sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive 

            IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso 

             

            EXEC @hr = sp_OAGetProperty @odrive,'TotalSize', @TotalSize OUT 

            IF @hr <> 0 EXEC sp_OAGetErrorInfo @odrive 

                             

            UPDATE drivesspace 

            SET TotalSize=@TotalSize/@MB 

            WHERE drive=@drive 

             

            FETCH NEXT FROM dcur INTO @drive 

     

    END 

     

    CLOSE dcur 

    DEALLOCATE dcur 

     

    EXEC @hr=sp_OADestroy @fso 

    IF @hr <> 0 EXEC sp_OAGetErrorInfo @fso 

     

    SELECT @@ServerName as ServerName,

           Drive as DriveLetter,

           TotalSize as 'DriveSize(MB)', 

           CAST((TotalSize / @GB) as dec(20)) as 'DriveSize(GB)', 

           FreeSpace as 'FreeSpace(MB)', 

           CAST((FreeSpace / @GB) as dec(20)) as 'FreeSpace(GB)',

           CAST((FreeSpace/(TotalSize*1.0))*100.0 as int) as 'Free(%)', 

           CAST((100-(FreeSpace/(TotalSize*1.0))*100.0) as int) as 'Full(%)',

           convert(varchar(8),getdate(),112) as RunDate

          FROM drivesspace 

    ORDER BY drive 

     

    truncate TABLE drivesspace 

     

    RETURN

    GO

    SET QUOTED_IDENTIFIER OFF

    GO

    SET ANSI_NULLS ON

    GO

    Can anyone pls help?

    Regards

  • I managed to run your proc without a problem.

    for the account you are using check to see if you have permissions to instantiate the 'Scripting.FileSystemObject' library. run the statement below

    DECLARE @hr int

    DECLARE @fso int

    --INSERT drivesspace(drive,FreeSpace)

    --EXEC master.dbo.xp_fixeddrives

    EXEC @hr=sp_OACreate 'Scripting.FileSystemObject',@fso OUT

    IF @hr 0 EXEC sp_OAGetErrorInfo @fso

    what is the result?


    Everything you can imagine is real.

  • Hi there,

    I am still getting the same error:

    0x80028019 ODSOLE Extended Procedure  Old format or invalid type library. NULL 0

    The error is displayed in different columns names. The stored proc that i am using does work on my other servers but for some reason it does not work on this particular one.

    Regards

  • did you try running the script i put above?


    Everything you can imagine is real.

  • yes i did, and i get the error that i posted above 

  • you can try instantiating the object in vb script and see if you get any errors there because I don't think the problem is with your sql installation.

    try this site http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan05/hey0112.mspx


    Everything you can imagine is real.

Viewing 6 posts - 1 through 5 (of 5 total)

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