Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > SQLRequest FunctionThis custom VB function establishes a connection to a data source, executes a SQL statement contained in query$, returns the results of the request in the ref() array, and closes the connection. NOTE: Siebel VB SQLxxxx functions are supported for non-Unicode databases only. SyntaxSQLRequest(connectString, query, outputString[, prompt][, columnNames], ref())
ReturnsA variant containing a negative-numbered error code if the connection cannot be made, the query is invalid, or another error condition occurs. If the request is successful, returns a positive number representing the number of results returned or rows affected. Other SQL statements return 0. UsageThe SQLRequest function establishes a connection to the data source specified in connectString, executes the SQL statement contained in query, returns the results of the request in the ref() array, and closes the connection. 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. ExampleFunction WebApplet_PreInvokeMethod (MethodName As String) As Integer ' The following opens the datasource SVBTESTW and Dim errors(1 To 10, 1 To 3) As Variant ' In the event of a connection error, do not display a ' SQL Statement to submit. In this example we'll perform a ' Invoke the SQLRequest function to submit the SQL, execute the ' If retCode < 0, an error has occurred. Retrieve the first While errors(errCounter,1) <> 0 errCounter = errCounter + 1 WebApplet_PreInvokeMethod = CancelOperation See AlsoSQLClose Function |
Siebel VB Language Reference |