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

OdbcConnectW
Syntax
OdbcConnectW(str_dbidentifier, str_data_source, str_userID, str_password, str_codepage);
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
str_codepage
Description
Connects the user to the data source. If the data retrieved with ODBCGetFirst, ODBCGetNext, or ODBCGetOne is of Unicode type, you must use the OdbcConnectW (instead of OdbcConnect) when connecting to the data source. You can also set the code page after the connection is established with the OdbcSetCodepage function.
You do not need to use OdbcConnectW 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 str_dbidentifier is already associated with a data source, no new connection is established. The existing connection remains open.
Note:
If you call ODBCConnectW 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", "ISO 8859-2");
OpenText StreamServe 5.6.2 Updated: 2018-01-26