I am facing a problem I have created a dll which exports a sql server view to a dtsflatfile but i cannot get it to execute from a stored procedure

The DLL is ExportToText and the object is ExportViewToText

If I do this from VB it works

Sub main()
Dim pet As New ExportToText.ExportViewToText
pet.FileName = "try3"
pet.viewName = "prem.gibsonloc"
pet.tableName = "Location"
pet.MainDTSSQLRoutine
End Sub

if i do this from SQL Server stored procedure nothing happens no error messages nothing , the export doesnt work either

CREATE proc prem.ViewToText @fileName varchar(255), @viewName varchar(255), @tableName varchar(255) as


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

EXEC @hr = sp_OACreate 'ExportToText.ExportViewToText', @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

EXEC @hr = sp_OASetProperty @object, 'viewName', @viewName


IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END

EXEC @hr = sp_OASetProperty @object, 'fileName', @fileName


IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END

EXEC @hr = sp_OASetProperty @object, 'tableName', @tableName


IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END

EXEC @hr = sp_OAMethod @object, 'MainDTSSQLRoutine'

IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END

EXEC @hr = sp_OADestroy @object
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object
RETURN
END
GO


any idea anyone ???????