General Info. About the FoxPro Connectivity Kit and ODBC

Last reviewed: October 21, 1996
Article ID: Q116235
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 5.0
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro Connectivity Kit, versions 2.5, 2.6

SUMMARY

The FoxPro Connectivity Kit and ODBC provide a methodology for communicating with different data sources using a common syntax.

MORE INFORMATION

The FoxPro Connectivity Kit

The 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.

  • Single-Tier ODBC Drivers

    Single-tier drivers are used when the processing of SQL statements must be done by the driver itself; that is, when there is no back-end server to process the SQL statements. Thus, single-tier drivers are used to connect to dBASE, FoxPro, Paradox, Btrieve, Microsoft Access, Microsoft Excel, and text files.

    All of the Microsoft single-tier drivers use SIMBA.DLL and/or TXTISAM.DLL as the database "engine."

  • Multitier ODBC Drivers

    Multitier drivers do not contain any processing capability and rely on a client-server DBMS to process SQL statements. SQL Server and ORACLE are two of the best known examples of a client-server DBMS.

ODBC Conformance Levels

There 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 Functions

ODBC 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
               Kit

ODBC 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
CK multi-tier
KBCategory: kbtool kbprg kbref kbinterop
KBSubcategory: FxtoolCk


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 21, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.