SIMPOL Documentation

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:

  1. 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.

  2. 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.

  3. 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 datasourcename, string username, string authentication, string browsestring, string browseresult, string driverstring, string driverresult, boolean connected, odbc1error error )

Parameters

ParameterDefault valueType nameDescription
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.nulstring 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.nulstring 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.nulboolean This parameter will be set to .true if the connection attempt is successful, or .false if it is not.
error.nulodbc1error 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

PropertyTypeDescription
_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.
typetype Specifies the odbc1connection type object.

Methods

browseconnect()

Description

Attempts to connect using odbc1connection object and the supplied information.

Prototype

odbc1connectionvar.browseconnect ( string browsestring, string browseresult, boolean connected, odbc1error error )

Parameters
ParameterDefault valueType nameDescription
browsestring""string The browse string to be used to attempt a browse connection.
browseresult.nulstring 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.nulboolean This parameter will be set to .true if the connection attempt is successful, or .false if it is not.
error.nulodbc1error 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 statement, odbc1error error )

Parameters
ParameterDefault valueType nameDescription
statement.nulstring The SQL statement to be prepared for execution.
error.nulodbc1error 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.