Click or drag to resize

SQLConnection Class

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:  VO
Assembly:  VOSQLClasses (in VOSQLClasses.dll) Version: 2.21
Syntax
 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 propertyActiveStmts
List of active statements for the connection
Public propertyConnected
A logical value representing whether the SQL connection object is connected.
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
A long integer representing the connection handle.
Public propertyDataSource
A string representing the ODBC data source name.
Public propertyEnvHandle
A long integer representing the environment handle.
Public propertyErrInfo
SqlErrorInfo object for the last error occured for the connection or NIL.
Public propertyHyperLabel
The hyperlabel of the connection containing the name of the data source, or NIL, if there is no data source name.
Public propertyIdentifierQuoteChar
A string used to surround a delimited identifier for this connection.
Public propertyIsolationOption
A constant representing the isolation level of the SQL connection.
Public propertyODBCCursors
A constant representing the cursor type for the SQL connection.
Public propertyPassword
A string containing the ODBC password (authorization string).
Public propertyPositionOps
A logical value representing whether the driver supports positioned operations
Public propertyScrollConcurrency
A constant representing the concurrency level of the SQL connection.
Public propertyScrollCsr
A logical value representing whether the driver supports scrollable cursors.
Public propertyStatus
A hyperlabel of the SQLConnection object containing the error message, or NULL_OBJECT, if no error has occurred.
Public propertyUserID
A string representing the ODBC user ID.
Top
Methods
  NameDescription
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 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
Return current setting for a connection option.
Public methodInfo
Return current setting for connection information.
Public methodisFunction
Determine whether an ODBC function is supported by the driver.
Public methodReconnect
Disconnect the current user from a data source; if connected; then, connect.
Public methodRollback
Public methodSetConnectOption
Set the value of a connection option.
Top
Fields
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

Reference