The information in this article applies to:
SYMPTOMS
The optparam$ parameter of the Visual Basic Library for SQL Server
(VBSQL) function SqlSetOpt%() specifies the desired parameter of a
particular option to be set. This parameter must always be passed
to the function as a string enclosed in quotation marks, even in
the case of numeric values. For example, the following line of code
calls the SqlSetOpt%() function and sets the SQLBUFFER option to
100 rows:
In addition, it is also possible to pass the parameter to the function as a string variable:
However, in Basic, it is common to convert numeric variables to strings with the STR$ function before passing them to other functions. This can lead to problems when calling SqlSetOpt%() because during the conversion process, the STR$ function automatically concatenates a space onto the left side of the resulting string. This additional space causes SqlSetOpt%() to fail with the following error:
WORKAROUND
To work around this problem, you can use the LTRIM$ function to strip
off any leading spaces prior to calling SqlSetOpt%(). The following
example works properly:
Keywords : kbinterop SSrvVisB |
Last Reviewed: March 12, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |