SQL Server Methods that Return Long Strings

SQL Server Methods that Return Long Strings Some ActiveX methods return strings that are too long for local string variables. How can these be returned to the calling stored procedure? Answer The Chilkat Global object has a property named KeepStringResult which can be set to 1. (The default value is 0.) When set to 1, then each method that returns […]

Returning Binary Data from ActiveX to SQL Server varbinary(max)

The error -2147211494 (hex 0x80040202) in SQL Server when using “sp_OAMethod” typically indicates a type mismatch or invalid data type issue, particularly when interacting with COM objects that return binary data. The Chilkat ActiveX returns a SAFEARRAY of VT_UI1, which causes the problem explained below.  The solution is to instead look for the Chilkat method that returns the binary data as […]

SQL sp_OAMethod String Length Return Value Limitations

The sp_OAMethod function is used to call ActiveX methods in SQL stored procedures.  If the ActiveX method returns a string, there is a limit imposed by sp_OAMethod on the size of the string that can be returned.  (Perhaps it is 4000 chars?) This blog post describes a way to workaround this limitation. An example of a method call that is […]