Actually when tried to Register with Command "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm /tlb classlibrary2.dll"
i did not get Success full message..... Dos screen came for the fraction of seconds and i am not able to read the message. Whwn i tried to call DLL with my Trigger and with "sp_OACreate " i did not get any error message. My trigger is to INSERT Command. and my trigger is:
alter TRIGGER [trgcom] ON [dbo].[BARCODE]
FOR INSERT, UPDATE
AS
DECLARE @retVal int
DECLARE @comHandle INT
DECLARE @errorSource VARCHAR(8000)
DECLARE @errorDescription VARCHAR(8000)
DECLARE @retString VARCHAR(100)
DECLARE @retTot int
DECLARE @nval1 int
DECLARE @nval2 int
DECLARE @ID int
Select @nval1 = a, @nval2 = b,@ID=id,@retString = t
from BARCODE
EXEC @retVal = sp_OACreate '{0D39F056-DF63-3860-9E79-B57F6358FD4D}', @comHandle
OUTPUT, 4
IF (@retVal <> 0)
BEGIN
-- Error Handling
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, 'WriteToFile',NULL,
@retString
IF (@retVal <> 0)
BEGIN
-- Error Handling
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, 'AddTwoNumbers',@retTot
OUTPUT, @nval1,@nval2
IF (@retVal <> 0)
BEGIN
-- Error Handling
EXEC sp_OAGetErrorInfo @comHandle, @errorSource OUTPUT, @errorDescription
OUTPUT
SELECT [Error Source] = @errorSource, [Description] = @errorDescription
RETURN
END
-- Update table
update BARCODE set [sum] = @rettot where id = @id
-- Release the reference to the COM object
EXEC sp_OADestroy @comHandle
When i tried to insert a row , this time a got a error message
Error source: ODSOLE Extended Procedure Description: Class not registered.
Pls provide me some solution..