XL: TypeNum 3 Not Supported By Most ODBC Data SourcesLast reviewed: February 3, 1998Article ID: Q129901 |
The information in this article applies to:
SUMMARYWhen you use the SQLGetSchema function with a value of 3 for the TypeNum argument, information will be returned only for certain open database connectivity (ODBC) databases.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/default.aspSQLGetSchema, a function included in the XLODBC.XLA add-in, is used to return information about the structure of the data source on a particular connection. TypeNum, one of the arguments of SQLGetSchema, is used to specify the type of information you want returned about the data source. The syntax for this function is:
SQLGetSchema(ConnectionNum, TypeNum, QualifierText)Using a value of 3 for the TypeNum argument returns a list of owners in a database on the current connection. Owner lists can be generated only with the following ODBC database drivers:
Microsoft SQL Server, version 4.2x and later Oracle, versions 6.0 and 7.0 Sybase SQL Server (contact Sybase Corporation technical support for a list of supported versions)To find out whether or not a data source can support a list of database owners, connect to the data source with Microsoft Query. In the Add Table dialog box, there is an Owners drop-down list box. If this drop-down list box is unavailable, then the driver does not support the use of Owners. Below is an example using the SQLGetSchema function to return a list of database owners.
Sample Visual Basic Procedure
Sub GetOwnerList() ' Open a communication channel to the database. chan = SQLOpen("DSN=My SQL Server Database") ' Get Owner list for the MyDB database. OwnerList = SQLGetSchema(chan, 3, "MyDB") ' Loop through the owner list and display the values. For Each OwnerName In OwnerList MsgBox OwnerName Next ' Close the communication channel. SQLClose chan End Sub REFERENCESFor more information about SQLGetSchema, click the Search button in Visual Basic Reference Help and type:
sqlgetschemaFor additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q163435 TITLE : VBA: Programming Resources for Visual Basic for Applications |
Additional query words: XL5 XL7 XL97 disabled dimmed
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |