Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel VB Language Reference > Siebel VB Language Reference >
SQLGetSchema Function
This custom VB function returns a variety of information, including information on the data sources available, current user ID, names of tables, names and types of table columns, and other data source/database related information.
NOTE: Siebel VB SQLxxxx functions are supported for non-Unicode databases only.
Syntax
SQLGetSchema connection, action, qualifier, ref()
Returns
A variant whose value depends on the action requested, as determined by the values in Table 8. A negative return value indicates an error. A -1 is returned if the requested information cannot be found or if the connection is not valid.
Usage
The destination array must be properly dimensioned to support the action, or an error is returned. Actions 2 and 3 are not currently supported. Action 4 returns every table and does not support the use of the qualifier. Not every database product and ODBC driver support every action.
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.
Example
This example opens the data source named SblTest, gets the names in the ODBC data sources, and closes the connection.
Sub Button_Click
'Declarations
Dim outputStr As String
Dim connection As Long
Dim prompt As Integer
Dim datasources(1 To 50) As Variant
Dim retcode As Variant
prompt = 5
'Open the data source "SblTest"
connection = SQLOpen("DSN=SblTest; UID=SADMIN; PWD=SADMIN", outputStr,prompt:=4)
action1 = 1 ' Get the names of the ODBC data sources
retcode = SQLGetSchema(connection:= connection,action:= 1,qualifier:= qualifier, ref:= datasources())
'Close the data source connection
retcode = SQLClose(connection)
End SubSee Also
SQLClose Function
SQLError Function
SQLExecQuery Function
SQLOpen Function
SQLRequest Function
SQLRetrieve Function
SQLRetrieveToFile Function
Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel VB Language Reference Published: 18 June 2003 |