Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(SQL Server) ZATCA Decode QR CodeSee more ZATCA ExamplesDecodes a base64 ZATCA QR code. Note: This example requires Chilkat v9.5.0.92 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 -- Note: This example requires Chilkat v9.5.0.92 or greater. DECLARE @qr nvarchar(4000) SELECT @qr = 'ARdBaG1lZCBNb2hhbWVkIEFMIEFobWFkeQIPMzAwMDc1NTg4NzAwMDAzAxQyMDIyLTAzLTEzVDE0OjQwOjQwWgQHMTEwOC45MAUFMTQ0LjkGLCtiQTFtdWNWSTY3SDRXQ2JOL2U5SjJxVXBIVHQzVHdNZHhsa09XVGVvdjg9B2BNRVlDSVFDWWg1ZTNpcklxV2w1WXRhQ25LaXVqTUlUbW9rWFlPUE1wSURDSW9XVzc5d0loQU1YbWMrTUZIR3RhZUJzZU91RUdUbHdENmcwOWdOUVBSUHVZODlzNjVPV1MIWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABNMAr2WtNWSj2uSrplhxz0cNFk/hv1LjMDgqbthcn6ydNWEuTNTQeyZJf1SfyMOFFM4cMpp+3wL+65Rj3fi+4w0JSDBGAiEAlcAzHKujzvjHJrAV1M/79RnYRqe66kmtgMUykr/N/CACIQDgTQwbfftw0pYo6FX8c63Q4edvFgt+7JhHaBlla0qRtQ==' SELECT @qr = 'AQxGaXJveiBBc2hyYWYCCjEyMzQ1Njc4OTEDEzIwMjEtMTEtMTcgMDg6MzA6MDAEBjEwMC4wMAUFMTUuMDAGLDlmc3JYVW8rU3BYQVlJTkw5aGFLU2dEOXgxaVJsZk53SVBDZnBlWXczYTA9B1hYMEM4VjFIL3hUMGdOaytWWXh2U2Z6UFJlUjZPM2t5VXA0TERITzJLMzlNSGJETXVvTGltQSt3RnovV2pVdEdMSHpaK0J5enNmWUdEQzliNUFGSU1FQT09CFgwVjAQBgcqhkjOPQIBBgUrgQQACgNCAARw3B+mu14x0h3pJFKqEWWT7DmD7jWYkZV7qHyikPlN4P/4/b7YD+A9wnFI92HTKm+/BGKXVf/pfLtsmdIIaPHnCUgwRgIhAMTjOkWwcNu5Aw5k1Yr3YgbPhdxKoJV1a3+5ShPtx1/IAiEAyrwsA/NuqV6XjybyrZpMp6eJAqslACLfCldti/PVOQs=' DECLARE @bd int -- Use "Chilkat_9_5_0.BinData" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.BinData', @bd OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @success int EXEC sp_OAMethod @bd, 'AppendEncoded', @success OUT, @qr, 'base64' DECLARE @index int SELECT @index = 0 DECLARE @expectedTag int SELECT @expectedTag = 1 DECLARE @tag int DECLARE @len int DECLARE @tagValue nvarchar(4000) WHILE (@expectedTag <= 9) BEGIN -- Get the tag EXEC sp_OAMethod @bd, 'GetByte', @tag OUT, @index IF @tag <> @expectedTag BEGIN PRINT 'Expected tag ' + @expectedTag EXEC @hr = sp_OADestroy @bd RETURN END SELECT @index = @index + 1 EXEC sp_OAMethod @bd, 'GetByte', @len OUT, @index IF @len = 0 BEGIN PRINT 'Expected length > 0' EXEC @hr = sp_OADestroy @bd RETURN END SELECT @index = @index + 1 -- Tags 8 and 9 contain binary data. IF @expectedTag >= 8 BEGIN EXEC sp_OAMethod @bd, 'GetEncodedChunk', @tagValue OUT, @index, @len, 'base64' END ELSE BEGIN EXEC sp_OAMethod @bd, 'GetTextChunk', @tagValue OUT, @index, @len, 'utf-8' END PRINT 'tag ' + @tag + ': ' + @tagValue SELECT @index = @index + @len SELECT @expectedTag = @expectedTag + 1 END EXEC @hr = sp_OADestroy @bd END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.