odbc1connection
Description
Creates a new odbc1connection object and establishes a connection to an ODBC datasource.
Type Tags
None
Object Value
Objects of type odbc1connection have no value, and it is an error to try to get or set this value.
odbc1connection.new()
Description
Creates a new odbc1connection object and attempts to connect in one of three ways:
To connect using the first mechanism, datasourcename, username and authentication should be used to give the name of a data source and a username/authentication string (password) to complete the connection. If the connection is successful then connected will be set to .true and a newly connected odbc1connection object is returned, otherwise error wil be filled with error information and .nul is returned.
To connect using the second mechanisme, browsestring and browseresult should be specified to be the input and output of an attempt to 'browse connect' to a data source (see the ODBC documentation for SQLBrowseConnect). If the connection is successful and complete, then connected will be set to .true and a newly connected odbc1connection object will be output. If the call is successful but the connection is not complete then connected is set to .false and a new odbc1connection object which is not yet connected is returned. If the call fails then error is filled with error information and .nul is returned.
To connect using the third mechanism, driverstring and driverresult should be specified to be the input and output of an attempt to connect using the ODBC 'driver connect' functionality (see the documentation of SQLDriverConnect). If the connection is successful the connected is set to .true and a newly connected odbc1connection object is returned. If the connection fails then error is filled with error information and .nul is returned.
Prototype
odbc1connection
.new
(
string
,
string datasourcename
,
string username
,
string authentication
,
string browsestring
,
string browseresult
,
string driverstring
,
boolean driverresult
,
odbc1error connected
)
error
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
datasourcename | "" | string | The data source name to which the connection is being made. |
username | "" | string | The user name to be used when logging into the connection. |
authentication | "" | string | The user's password for accessing the data source. |
browsestring | "" | string | The browse string to be used to attempt a browse connection. |
browseresult | .nul | string | The browse result string into which the result will be returned from the attempt to connect using the browsestring if it fails to connect through lack of information. This must be a pre-initialized string object! |
driverstring | "" | string | The driver string to be used to attempt a driver connection. |
driverresult | .nul | string | The driver result string into which the result will be returned from the attempt to connect using the driverstring if it fails to connect through lack of information. This must be a pre-initialized string object! |
connected | .nul | boolean | This parameter will be set to .true if the connection attempt is successful, or .false if it is not. |
error | .nul | odbc1error |
Specifies an object that is used to output any error information generated
during the execution of the method. This parameter must be an
object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified and
an error occurs during execution then the error code is output into
that object and the method returns .nul .
|
Properties
Property | Type | Description |
---|---|---|
_ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. |
__ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property. |
type | type | Specifies the odbc1connection type object. |
Methods
browseconnect()
Description
Attempts to connect using odbc1connection object and the supplied information.
Prototype
odbc1connectionvar
.browseconnect
(
string
,
string browsestring
,
boolean browseresult
,
odbc1error connected
)
error
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
browsestring | "" | string | The browse string to be used to attempt a browse connection. |
browseresult | .nul | string | The browse result string into which the result will be returned from the attempt to connect using the browsestring if it fails to connect through lack of information. This must be a pre-initialized string object! |
connected | .nul | boolean | This parameter will be set to .true if the connection attempt is successful, or .false if it is not. |
error | .nul | odbc1error |
Specifies an object that is used to output any error information generated
during the execution of the method. This parameter must be an
object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified
and an error occurs during execution then the error code is
output into that object and the method returns
.nul .
|
createstatement()
Description
Creates a SQL statement in preparation for executing the statement. If it fails, the error object will be filled in.
Prototype
odbc1connectionvar
.createstatement
(
string
,
odbc1error statement
)
error
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
statement | .nul | string | The SQL statement to be prepared for execution. |
error | .nul | odbc1error |
Specifies an object that is used to output any error information generated
during the execution of the method. This parameter must be an
object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified
and an error occurs during execution then the error code is
output into that object and the method returns
.nul .
|