Difference between revisions of "SQLCONNECT()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
|||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
− | Connect to | + | Connect to an ODBC data source |
==Syntax== | ==Syntax== | ||
− | SQLCONNECT( | + | SQLCONNECT(<nStatementHandle>) |
− | SQLCONNECT( | + | SQLCONNECT(<cDataSourceName> [, <cUserID> [, <cPassword>]]) |
− | + | ||
− | + | ||
==See Also== | ==See Also== | ||
Line 13: | Line 11: | ||
==Description== | ==Description== | ||
− | The SQLCONNECT() function is used to connect to | + | The SQLCONNECT() function is used to connect to an ODBC data source and return a statement handle for use by other SQL functions. |
− | |||
{| class="wikitable" | {| class="wikitable" | ||
!Keywords||Description | !Keywords||Description | ||
|- | |- | ||
− | |nStatementHandle||The workarea in which | + | |nStatementHandle||The workarea in which an ODBC data source is open and to which a new connection should be made. |
|- | |- | ||
|} | |} | ||
Line 29: | Line 26: | ||
!Keywords||Description | !Keywords||Description | ||
|- | |- | ||
− | + | |cDataSourceName||ODBC data source name | |
− | + | ||
− | |cDataSourceName||ODBC data source name | + | |
|- | |- | ||
|cUserID||Data source login user id | |cUserID||Data source login user id | ||
|- | |- | ||
|cPassword||Data source login password | |cPassword||Data source login password | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|} | |} | ||
Line 67: | Line 47: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | nStatHand = SQLCONNECT("awhr", "testuser", "password", .T.) | |
− | nStatHand=SQLCONNECT | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</code> | </code> | ||
Revision as of 11:04, 7 December 2012
Purpose
Connect to an ODBC data source
Syntax
SQLCONNECT(<nStatementHandle>)
SQLCONNECT(<cDataSourceName> [, <cUserID> [, <cPassword>]])
See Also
SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLDISCONNECT(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES(), SQLTRANSACTION()
Description
The SQLCONNECT() function is used to connect to an ODBC data source and return a statement handle for use by other SQL functions.
Keywords | Description |
---|---|
nStatementHandle | The workarea in which an ODBC data source is open and to which a new connection should be made. |
Or
Keywords | Description |
---|---|
cDataSourceName | ODBC data source name |
cUserID | Data source login user id |
cPassword | Data source login password |
Return values:
Return Value | Description |
---|---|
>0 | Statement handle to connection |
–2 | Connection creation error |
Example
nStatHand = SQLCONNECT("awhr", "testuser", "password", .T.)