Difference between revisions of "SQLCONNECT()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Helen.george (Talk | contribs) |
||
Line 11: | Line 11: | ||
The SQLCONNECT() function is used to connect to an ODBC data source and return a statement handle for use by other SQL functions. | 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" width=100% | + | {| class="wikitable" width="100%" |
− | !width=30%|Keywords||width=70%|Description | + | !width="30%"|Keywords||width="70%"|Description |
|- | |- | ||
|cDataSourceName||ODBC data source name | |cDataSourceName||ODBC data source name | ||
Line 24: | Line 24: | ||
====Return values:==== | ====Return values:==== | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=30%|Return Value||width=70%|Description | + | !width="30%"|Return Value||width="70%"|Description |
|- | |- | ||
|>0||Statement handle to the connection | |>0||Statement handle to the connection |
Latest revision as of 10:18, 31 January 2013
Purpose
Connect to an ODBC data source
Syntax
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 |
---|---|
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 the connection |
–2 | Connection creation error |
Example
nStatHand = sqlconnect("mylocal") // or nStatHand = sqlconnect("Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=mydb","myuser","mypass")