Click or drag to resize

SQLConnection Class (Typed)

X#
Manage an SQL connection to an ODBC data source. A SQLConnection object is needed before any database operations can be performed.
Inheritance Hierarchy
Object
  SQLConnection

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOSQLClasses (in XSharp.VOSQLClasses.dll) Version: 2.19
Syntax
[TypesChangedAttribute]
 CLASS SQLConnection
Request Example View Source

The SQLConnection type exposes the following members.

Constructors
  NameDescription
Public methodSQLConnection
Construct an SQL connection.
Top
Properties
  NameDescription
Public propertyAccessMode
A constant representing the SQL connection's access mode.
Public propertyConnected
A logical value representing whether the SQL connection object is connected.
Public propertyConnectionHandle
Public propertyConnectString
A string representing the connection parameters (for example, "DSN=<Source>;UID=<UserID>;PWD=<Authorization>"). This string is initialized during the SQLConnection:Connect() or SQLConnection:DriverConnect() methods.
Public propertyConnHandle Obsolete.
A long integer representing the connection handle.
Public propertyDataSource
A string representing the ODBC data source name.
Public propertyDataSourceName
Public propertyDataSourceVersion
Public propertyErrInfo
SqlErrorInfo object for the last error occured for the connection or NIL.
Public propertyFactory
Public propertyGroupByBehavior
Public propertyHyperLabel
The hyperlabel of the connection containing the name of the data source, or NIL, if there is no data source name.
Public propertyIdentifierCase
Public propertyIdentifierQuoteChar
A string used to surround a delimited identifier for this connection.
Public propertyIsolationOption Obsolete.
A constant representing the isolation level of the SQL connection.
Public propertyNetConn
Public propertyODBCCursors Obsolete.
A constant representing the cursor type for the SQL connection.
Public propertyOrderByColumnsInSelect
Public propertyPassword
A string containing the ODBC password (authorization string).
Public propertyPositionOps Obsolete.
A logical value representing whether the driver supports positioned operations
Public propertyQuotedIdentifierCase
Public propertyScrollConcurrency Obsolete.
A constant representing the concurrency level of the SQL connection.
Public propertyScrollCsr Obsolete.
A logical value representing whether the driver supports scrollable cursors.
Public propertyServer
Public propertyStatus
A hyperlabel of the SQLConnection object containing the error message, or NULL_OBJECT, if no error has occurred.
Public propertySupportedJoinOperators
Public propertyUserID
A string representing the ODBC user ID.
Top
Functions
  NameDescription
Public method_CreateCommand
Public method_CreateConnection
Public method_CreateDataAdapter
Public method_CreateParameter
Public method_ParseConnectionString
Public method_ReadProperties
Public methodBeginTransaction
Public methodCommit
Public methodConnect
Connect a user to an ODBC data source.
Public methodDisconnect
Disconnect the current user from an ODBC data source.
Public methodDoSimpleSelect
Public methodDriverConnect
Display a dialog box prompting for a source; after a source is selected, displays the driver's connection dialog box; then connects to the selected data source.
Public methodEndTransaction
Public methodGetConnectOption Obsolete.
Return current setting for a connection option.
Public methodStatic memberGetODBCDataSources
Public methodGetSchema
Public methodGetSchemaTable
Public methodInfo
Return current setting for connection information.
Public methodisFunction Obsolete.
Determine whether an ODBC function is supported by the driver.
Public methodNetConnect
Public methodReconnect
Disconnect the current user from a data source; if connected; then, connect.
Public methodRollback
Public methodSetConnectOption Obsolete.
Set the value of a connection option.
Top
Remarks
An SQLConnection object represents the connection to an ODBC data source. The data source (associated with a particular database) is set-up using the Microsoft ODBC administrator.
Examples
The following example demonstrates how to establish a connection to a source named SAMPLE:
X#
 1FUNCTION Start()
 2LOCAL oConn AS SQLConnection
 3oConn := SQLConnection{}
 4// SAMPLE source has been set up to connect to     // WATCOM
 5oConn:Connect("sample","dba","sql")
 6// Check for errors
 7IF IsNil(oConn:ErrInfo)
 8oConn:Disconnect()
 9ELSE
10oConn:ErrInfo:ShowErrorMsg()
11ENDIF
See Also