Script functions reference > Script functions in alphabetical order > O > OdbcConnect

OdbcConnect
Syntax
OdbcConnect(str_dbidentifier, str_data_source, str_userID,              str_password);
str_dbidentifier 
A name you specify which will be used in all the following ODBC functions to identify which data source they will access.
str_data_source
str_userID
str_password
Description
Connects the user to the data source. You do not need to use OdbcConnect for every scripting function. Once the server connection is established, it will only be closed when you call the OdbcDisconnect function, or when the job completes.
If the data retrieved with ODBCGetFirst, ODBCGetNext, or ODBCGetOne is of Unicode type, you should use the OdbcConnectW (instead of OdbcConnect) when connecting to the data source.
If str_dbidentifier is already associated with a data source, no new connection is established. The existing connection remains open.
Note:
If you call ODBCConnect twice without calling ODBCDisconnect in between, ODBCDisconnect will automatically be called before the new connection is made.
Returns
1
-1
Example
OdbcConnect("my_identifier","address.dsn","sa","abc_1");
OpenText StreamServe 5.6 Updated: 2013-03-01