Difference between revisions of "SQLSETPROP()"
Yvonne.milne (Talk | contribs) |
|||
(13 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Set property settings for a connection | Set property settings for a connection | ||
− | |||
==Syntax== | ==Syntax== | ||
SQLSETPROP(<nStatementHandle>, <cSetting> [, <eExpression>]) | SQLSETPROP(<nStatementHandle>, <cSetting> [, <eExpression>]) | ||
− | |||
==See Also== | ==See Also== | ||
− | + | [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLERROR()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]], [[SQLTRANSACTION()]] | |
==Description== | ==Description== | ||
− | The SQLSETPROP() function is used to set the property settings for a specified connection. | + | The SQLSETPROP() function is used to set the property settings for a specified connection. The SQLSETPROP() function operates on the ODBC data source specified by <nStatementHandle>. |
− | + | ||
− | The SQLSETPROP() function operates on the | + | |
+ | This function is not yet implemented. | ||
− | {| class="wikitable" | + | {| class="wikitable" width="100%"| |
− | !Keywords||Description | + | !width="30%"|Keywords||width="70%"|Description |
|- | |- | ||
− | |nStatementHandle|| | + | |nStatementHandle||Statement handle to the connection |
|- | |- | ||
|cSetting||The property setting to set. Please see table below for available property settings | |cSetting||The property setting to set. Please see table below for available property settings | ||
|- | |- | ||
− | |eExpression||The value to be set. If this optional parameter is not specified, the property is set to its default value. Please see table below for available property settings values | + | |valign=top|eExpression||The value to be set. If this optional parameter is not specified, the property is set to its default value. Please see table below for available property settings values |
|- | |- | ||
|} | |} | ||
− | |||
====Property Settings:==== | ====Property Settings:==== | ||
− | + | {| class="wikitable" width="100%"| | |
− | {| class="wikitable" | + | !width="15%"|Setting||width="15%"|Default||width="5%"|Read-only||width="70%"|Description |
− | !Setting||Default||Read-only||Description | + | |
|- | |- | ||
|Asynchronous||False (.F.)||No||Determines whether results sets are returned synchronously (.F.) or asynchronously (.T.) | |Asynchronous||False (.F.)||No||Determines whether results sets are returned synchronously (.F.) or asynchronously (.T.) | ||
Line 38: | Line 33: | ||
|BatchMode||True (.T.)||No||Determines whether results sets are returned all at once (.T.) or one at a time using [SQLMORERESULTS()] (.F.) | |BatchMode||True (.T.)||No||Determines whether results sets are returned all at once (.T.) or one at a time using [SQLMORERESULTS()] (.F.) | ||
|- | |- | ||
− | |ConnectBusy||||Yes||.T. = Shared connection is busy | + | |valign="top"|ConnectBusy||||valign=top|Yes||.T. = Shared connection is busy |
.F. = Shared connection is not busy | .F. = Shared connection is not busy | ||
|- | |- | ||
Line 47: | Line 42: | ||
|DataSource||||No||Data source name as specified in ODBC.INI | |DataSource||||No||Data source name as specified in ODBC.INI | ||
|- | |- | ||
− | |DispLogin||1||No||1 = The Login dialog box is displayed if any required information is missing | + | |valign="top"|DispLogin||valign=top|1||valign=top|No||1 = The Login dialog box is displayed if any required information is missing |
2 = The Login dialog box is always displayed | 2 = The Login dialog box is always displayed | ||
3 = The Login dialog box is never displayed and an error is generated if any required information is missing | 3 = The Login dialog box is never displayed and an error is generated if any required information is missing | ||
|- | |- | ||
− | |DispWarnings||False (.F.)||No||.T. = Error messages are displayed | + | |valign="top"|DispWarnings||valign=top|False (.F.)||valign=top|No||.T. = Error messages are displayed |
.F. = Error messages are not displayed | .F. = Error messages are not displayed | ||
|- | |- | ||
Line 66: | Line 61: | ||
|QueryTimeOut||0 (Wait indefinitely)||No||Determines the time to wait before generating a time-out error. (0 – 600 seconds) | |QueryTimeOut||0 (Wait indefinitely)||No||Determines the time to wait before generating a time-out error. (0 – 600 seconds) | ||
|- | |- | ||
− | |Shared||||Yes||.T. = Connection is shared | + | |valign=top|Shared||||valign=top|Yes||.T. = Connection is shared |
.F. = Connection is not shared | .F. = Connection is not shared | ||
|- | |- | ||
− | |Transactions||1||No||1 = Automatic transaction handling | + | |valign="top"|Transactions||valign=top|1||valign=top|No||1 = Automatic transaction handling |
2 = Manual transaction handling using [SQLCOMMIT()] and [SQLROLLBACK()] | 2 = Manual transaction handling using [SQLCOMMIT()] and [SQLROLLBACK()] | ||
|- | |- | ||
Line 77: | Line 72: | ||
|- | |- | ||
|} | |} | ||
− | |||
====Return values:==== | ====Return values:==== | ||
− | + | {| class="wikitable" width="100%" | |
− | {| class="wikitable" | + | !width="30%"|Return Value||width="70%"|Description |
− | !Return Value||Description | + | |
|- | |- | ||
|1||Property setting completed successfully | |1||Property setting completed successfully | ||
Line 92: | Line 85: | ||
|- | |- | ||
|} | |} | ||
− | |||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | nStatHand = | + | nStatHand = sqlconnect("awhr") |
if nStatHand < 1 | if nStatHand < 1 | ||
− | + | messagebox("Could not connect") | |
else | else | ||
− | nSetEnd = | + | nSetEnd = sqlsetprop(nStatHand,"Transactions",2) |
if nSetEnd = 1 | if nSetEnd = 1 | ||
− | + | messagebox("Manual Transactions Enabled") | |
else | else | ||
− | + | messagebox("Unable to enable Manual Transactions") | |
endif | endif | ||
+ | sqldisconnect(nStatHand) | ||
endif | endif | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:SQL]] | [[Category:SQL]] | ||
− | [[Category: | + | [[Category:ODBC Functions]] |
+ | [[Category:SQL Functions]] | ||
+ | [[Category:VFP Not Implemented]] |
Latest revision as of 09:07, 4 February 2013
Contents
Purpose
Set property settings for a connection
Syntax
SQLSETPROP(<nStatementHandle>, <cSetting> [, <eExpression>])
See Also
SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLERROR(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSTRINGCONNECT(), SQLTABLES(), SQLTRANSACTION()
Description
The SQLSETPROP() function is used to set the property settings for a specified connection. The SQLSETPROP() function operates on the ODBC data source specified by <nStatementHandle>.
This function is not yet implemented.
Keywords | Description |
---|---|
nStatementHandle | Statement handle to the connection |
cSetting | The property setting to set. Please see table below for available property settings |
eExpression | The value to be set. If this optional parameter is not specified, the property is set to its default value. Please see table below for available property settings values |
Property Settings:
Setting | Default | Read-only | Description |
---|---|---|---|
Asynchronous | False (.F.) | No | Determines whether results sets are returned synchronously (.F.) or asynchronously (.T.) |
BatchMode | True (.T.) | No | Determines whether results sets are returned all at once (.T.) or one at a time using [SQLMORERESULTS()] (.F.) |
ConnectBusy | Yes | .T. = Shared connection is busy
.F. = Shared connection is not busy | |
ConnectString | Yes | Login connection string | |
ConnectTimeOut | 15 | No | Determines the time to wait before generating a connection time-out error. (0 – 600 seconds) |
DataSource | No | Data source name as specified in ODBC.INI | |
DispLogin | 1 | No | 1 = The Login dialog box is displayed if any required information is missing
2 = The Login dialog box is always displayed 3 = The Login dialog box is never displayed and an error is generated if any required information is missing |
DispWarnings | False (.F.) | No | .T. = Error messages are displayed
.F. = Error messages are not displayed |
IdleTimeout | 0 (Wait indefinitely) | No | Determines the time to wait before terminating an idle connection (seconds) |
ODBChdbc | Yes | Internal ODBC connection handle | |
ODBChstmt | Yes | Internal ODBC connection handle | |
PacketSize | 4K | No | Determines the network packet size used |
Password | Yes | Login connection password | |
QueryTimeOut | 0 (Wait indefinitely) | No | Determines the time to wait before generating a time-out error. (0 – 600 seconds) |
Shared | Yes | .T. = Connection is shared
.F. = Connection is not shared | |
Transactions | 1 | No | 1 = Automatic transaction handling
2 = Manual transaction handling using [SQLCOMMIT()] and [SQLROLLBACK()] |
UserId | Yes | Login connection user id | |
WaitTime | 100 milliseconds | No | Determines the time to wait before checking that an SQL statement has completed |
Return values:
Return Value | Description |
---|---|
1 | Property setting completed successfully |
–1 | Connection error |
–2 | Environment error |
Example
nStatHand = sqlconnect("awhr") if nStatHand < 1 messagebox("Could not connect") else nSetEnd = sqlsetprop(nStatHand,"Transactions",2) if nSetEnd = 1 messagebox("Manual Transactions Enabled") else messagebox("Unable to enable Manual Transactions") endif sqldisconnect(nStatHand) endif