Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > SQLOpen FunctionThis custom VB function establishes a connection to an ODBC data source. NOTE: Siebel VB SQLxxxx functions are supported for non-Unicode databases only. SyntaxSQLOpen(connectString, [outputString][, prompt]) The following table lists the values for prompt. When prompt is omitted, 2 is assumed. ReturnsA long integer representing a unique connection ID, which can be used with other ODBC functions. The completed connection string is returned in outputString if this argument is used. If the connection cannot be established, then an ODBC error with a negative numeric value is returned. Test this value using the instructions in SQLError Function. UsageThe connectString variable generally takes the following form; however, it must follow the format dictated by the ODBC driver you are using.
As the example that follows shows, some parts of this string may not be required; you must supply whatever information is required by the ODBC driver to make the connection. For details on the connect string used to access a Siebel application, read Siebel Technical Note #206. CAUTION: This function, as well as the other SQL functions available in Siebel VB, should not be used to query the underlying database. Use the Siebel Object Interfaces to query Siebel data. Use the SQL functions only to query non-Siebel data. ExampleThis example opens the data source named SblTest, gets the names in the ODBC data sources, and closes the connection. Sub Button_Click See AlsoSQLClose Function |
Siebel VB Language Reference |