![]() |
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 Zip.AppendSb to Zip.AddSbProvides instructions for replacing deprecated AppendSb method calls with AddSb. 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 @zip int -- Use "Chilkat_9_5_0.Zip" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Zip', @zip OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END -- ... -- ... DECLARE @pathInZip nvarchar(4000) SELECT @pathInZip = 'example.txt' DECLARE @sb int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sb OUT DECLARE @success int EXEC sp_OAMethod @sb, 'Append', @success OUT, 'This is a test' DECLARE @charset nvarchar(4000) SELECT @charset = 'utf-8' -- ------------------------------------------------------------------------ -- The AppendSb method is deprecated: DECLARE @success int EXEC sp_OAMethod @zip, 'AppendSb', @success OUT, @pathInZip, @sb, @charset -- ------------------------------------------------------------------------ -- For consistency, the name has changed to AddSb. EXEC sp_OAMethod @zip, 'AddSb', @success OUT, @pathInZip, @sb, @charset EXEC @hr = sp_OADestroy @zip EXEC @hr = sp_OADestroy @sb END GO |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.