SqlIsOpt%

Checks the status of an option set by SqlSetOpt%.

Syntax

SqlIsOpt% ( sqlconn%, opt%, optparam$ )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%. Unlike the value of sqlconn% when you use SqlSetOpt% and SqlClrOpt%, the value of sqlconn% cannot be 0 when you use SqlIsOpt%.
opt%
Is the option to be checked. Do not enclose the option name in quotation marks. For a list of the options available in DB-Library for Visual Basic, see DB-Library for Visual Basic Options.
optparam$
Is a parameter for an option. You must include optparam$ for all options, whether or not they take parameters. Enclose optparam$ in quotation marks.

If an option does not take a parameter, optparam$ is ignored. If an option does take a parameter, optparam$ is ignored for all options except SQLOFFSET and SQLSTAT.

The SQLOFFSET and SQLSTAT options can have several settings, each with a different parameter. In these cases, SqlIsOpt% needs a valid optparam$ to determine which option parameter to check.

For a list of the options available in DB-Library for Visual Basic, see DB-Library for Visual Basic Options.

Returns

SUCCEED (1) or FAIL (0).

Remarks

Although you can set and clear SQL Server query options directly through Transact-SQL, design your application to use SqlSetOpt% and SqlClrOpt% to set and clear options because these functions provide a uniform interface for setting both SQL Server and Visual Basic options. With these functions, your application can also use SqlIsOpt% to check the status of an option. For a list of each option in DB-Library for Visual Basic and its default status, see DB-Library for Visual Basic Options.

See Also

SqlClrOpt%, SqlSetOpt%; DB-Library for Visual Basic Options