开发者

OLE Error in SQL

I have Windows Server 2003 Standard x64 Edition SP2 with

Microsoft SQL Server 2005 - 9.00.4035.00 (X64) Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

I downloaded CAPICOM Platform SDK Redistributable: http://www.microsoft.com/downloads/details.aspx?FamilyId=860EE43A-A843-462F-ABB5-FF88EA5896F6&displaylang=en

and installed it from c:\开发者_JS百科Windows\syswow64 with c:\Windows\syswow64\regsvr32.exe capicom.dll and it got registered succesfully.

When I tried to run

DECLARE @S varchar(255) 
DECLARE @D varchar(255)
DECLARE @O int

EXEC @C = sp_OACreate 'CAPICOM.EncryptedData', @O OUT
IF @C <> 0
BEGIN
  EXEC sp_oageterrorinfo @O, @S out, @D out 
  SELECT err=CONVERT(VARBINARY(4),@C), source=@S, description=@D
  RETURN
END

and I got error message.

0x80040154  ODSOLE Extended Procedure    Class not registered

What should I do? How should I check if CAPICOM.DLL is correctly registered?


This answer has a walkthrough of how to register a surrogate for CAPICOM so it can be used from 64-bit processes.

  • 64 bit C# with a 32 bit VB6 COM object

I have actually done this to use CAPICOM from 64-bit SQL Server and it works fine.


Here is the reason.
Is there a 64 bit version of this component?


CAPICOM will not ship 64 bit afaik, is deprecated:

CAPICOM is a 32-bit only component that is available for use in the following operating systems: Windows Server 2008, Windows Vista, Windows XP, and Windows 2000. Instead, use the .NET Framework to implement security features. For more information, see Alternatives to Using CAPICOM

Between the crypto functions in SQL 2005 itslef and the CRL procedures access to .Net crypto, frankly I don't see any reason to stick with the COM crypto API. Certainly, I understand that you can have legacy code and need to support it, bur for new development definetly a big no no.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜