![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) Transition from Crypt2.Decode to BinData.AppendEncodedProvides instructions for replacing deprecated Decode method calls with AppendEncoded. Note: This example requires Chilkat v11.0.0 or greater.
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @crypt2 int -- Use "Chilkat_9_5_0.Crypt2" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Crypt2', @crypt2 OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END -- ... -- ... DECLARE @encoding nvarchar(4000) SELECT @encoding = 'base64' -- ------------------------------------------------------------------------ -- The Decode method is deprecated: EXEC sp_OAMethod @crypt2, 'Decode', @byteData OUT, 'ENCODED_DATA...', @encoding -- ------------------------------------------------------------------------ -- Do the equivalent using BinData.AppendEncoded. DECLARE @bd int -- Use "Chilkat_9_5_0.BinData" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.BinData', @bd OUT DECLARE @success int EXEC sp_OAMethod @bd, 'AppendEncoded', @success OUT, 'ENCODED_DATA...', @encoding EXEC sp_OAMethod @bd, 'GetData', @byteData OUT EXEC @hr = sp_OADestroy @crypt2 EXEC @hr = sp_OADestroy @bd END GO |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.