简体   繁体   中英

Chilkat SQL not working/returning anything

I am trying 30 days free trial of Chilkat and I am not getting any results in SQL, nor error information (unless it is a string text value, hardcoded). I have installed the module on the server and it confirms correctly

For example this piece of code with obviously incorrect address just runs through without any feedback (the code is from their tutorial - apart from the address - so should be technically correct)

 DECLARE @hr int DECLARE @iTmp0 int DECLARE @sTmp0 nvarchar(max) DECLARE @rest int EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Rest', @rest OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END -- Connect to the REST server. DECLARE @bTls int SELECT @bTls = 1 DECLARE @port int SELECT @port = 443 DECLARE @bAutoReconnect int SELECT @bAutoReconnect = 1 DECLARE @success int EXEC sp_OAMethod @rest, 'Connect', @success OUT, 'www.incorrect_address.co', @port, @bTls, @bAutoReconnect IF @success <> 1 BEGIN EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @rest RETURN END

the Global Unlock method returns message that it is working

'Unlocked in trial mode.'

do you have any idea why it does not work? Any messages hardcoded (like 'unlocked in trial mode') are working but anything that should return values of objects - does not.

I have of course enabled Configuration option 'Ole Automation Procedures' in SQL

Slav

The contents of the LastErrorText property is likely too large for limits imposed by sp_OAGetProperty. Try using a temp table like this:

   DECLARE @tmp1 TABLE (lastErrText ntext)
   INSERT INTO @tmp1 EXEC sp_OAGetProperty @rest, 'LastErrorText'
   SELECT * from @tmp1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM