General Info. About the FoxPro Connectivity Kit and ODBCLast reviewed: October 21, 1996Article ID: Q116235 |
The information in this article applies to:
SUMMARYThe FoxPro Connectivity Kit and ODBC provide a methodology for communicating with different data sources using a common syntax.
MORE INFORMATION
The FoxPro Connectivity KitThe FoxPro Connectivity Kit provides FoxPro users with a "pass through" SQL capability; in other words, you can pass SQL commands to the ODBC data source by using functions provided with the Connectivity Kit. This capability is provided through 12 functions that are used to perform various ODBC-related tasks. Single and Multitier ODBC Drivers Current ODBC drivers fall into one of the following two categories: single- tier or multitier.
ODBC Conformance LevelsThere are two conformance levels for ODBC: API and SQL. The API conformance levels are Core, Level 1, and Level 2. These specify varying degrees of API support. Most current ODBC drivers are Level 1 and partially implement Level 2 features, such as scrollable cursors. (For a detailed discussion of this topic, refer to the ODBC SDK documentation listed at the end of this article.) The ODBC SQL conformance level is related to the SQL grammar implementation, and falls into one of the following three categories:
Minimum - All ODBC drivers should implement this level. Core - Most ODBC drivers meet or exceed this level. Extended - Many ODBC drivers partially implement this level.The syntax for each level can be obtained from the ODBC SDK documentation, which is listed at the end of this article.
Scalar FunctionsODBC has a number of functions built-in to allow language independence between various database management systems. A list of these functions can be found in the following Microsoft Knowledge Base articles:
ARTICLE-ID: Q103142 TITLE : SQL Server String Funcs Supported by the Connectivity Kit ARTICLE-ID: Q103576 TITLE : SQL Server Time/Date Func Support for Connectivity Kit ARTICLE-ID: Q103578 TITLE : SQL Server Numeric Funcs Supported by Connectivity Kit ARTICLE-ID: Q104342 TITLE : SQL Server System Funcs Supported by the Connectivity KitODBC functions are implemented with an ODBC "escape shorthand" syntax. This syntax looks like:
{fn ODBCFunction([Arguments])}The following example shows how the DBExec() function in the Connectivity Kit can be used with the SQRT() ODBC function:
lnResult=DBExec(dbHdle, "SELECT {fn sqrt(4)}","output")In Visual FoxPro, use the following command:
lnResult=SQLExec(dbHdle, "SELECT {fn sqrt(4)}","output")To see an additional example of ODBC scalar functions, use the ClientServer Wizard in the Professional edition of FoxPro version 2.6 for Windows to create an outer join, and then examine the generated code.
REFERENCES"Microsoft ODBC 2.0 Programmer's Reference and SDK Guide," Microsoft Press
|
Additional reference words: 5.00 VFoxWin 3.00 FoxWin 2.50 2.50a 2.50b 2.60
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |