Difference between revisions of "SQLSTRINGCONNECT()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 23: | Line 23: | ||
!width=30%|Return Value||width=70%|Description | !width=30%|Return Value||width=70%|Description | ||
|- | |- | ||
− | |> 0||Statement handle to connection | + | |> 0||Statement handle to the connection |
|- | |- | ||
|–1||Connection creation error | |–1||Connection creation error |
Revision as of 11:30, 7 January 2013
Purpose
Connect to a data source
Syntax
SQLSTRINGCONNECT(<cConnectString>)
See Also
SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLERROR(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLTABLES()
Description
The SQLSTRINGCONNECT() function is used to connect to a data source and return a statement handle for use by other SQL functions.
Keywords | Description |
---|---|
cConnectString | The ODBC data source connection string or ODBC DSN. |
Return values:
Return Value | Description |
---|---|
> 0 | Statement handle to the connection |
–1 | Connection creation error |
Example
// Store the return value to use as the nStatementHandle for subsequent function calls // Specify an ODBC DSN nStatHand = sqlstringconnect("awhr") // or an ODBC connection string nStatHand = sqlstringconnect("Driver={SQL Server};Server=MYPC-PC\INST1;Trusted_Connection=yes;Database=AdventureWorks;")