[go: up one dir, main page]

0% found this document useful (0 votes)
537 views488 pages

Visual FoxPro ODBC Driver

The document discusses Microsoft-supplied ODBC drivers, including desktop database drivers, Oracle and Visual FoxPro drivers. It covers using 16-bit and 32-bit applications with 32-bit drivers, driver architecture, programming considerations, limitations and supported functions.

Uploaded by

sirajul islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
537 views488 pages

Visual FoxPro ODBC Driver

The document discusses Microsoft-supplied ODBC drivers, including desktop database drivers, Oracle and Visual FoxPro drivers. It covers using 16-bit and 32-bit applications with 32-bit drivers, driver architecture, programming considerations, limitations and supported functions.

Uploaded by

sirajul islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 488

Table of Contents

Microsoft-Supplied ODBC Drivers


Using 16-Bit and 32-Bit Applications with 32-Bit Drivers
Using 16-Bit Applications with 32-Bit Drivers
Using 32-Bit Applications with 32-Bit Drivers
Microsoft ODBC Desktop Database Drivers
Desktop Database Drivers Architecture
History of the Desktop Database Drivers
Product Support
Implementing Desktop Database Drivers
Files to Use with the Desktop Database Drivers
ODBC Component Files
Hardware and Software Requirements (ODBC)
Descriptors and Desktop Database Drivers
Diagnostics for Desktop Database Drivers
Functions Accepting String Parameters
SQL-92 Compliance
Base Address of Drivers
Setup DLL
Translation DLLs and Desktop Database Drivers
Desktop Database Driver Compatibility
Desktop Database Driver Performance Issues
Microsoft Access Driver Programming Considerations
Setting Options Programmatically for the Access Driver
Microsoft Access Data Types
SQLGetInfo Returned Values for Access
Other Access Driver Programming Details
Microsoft Excel Driver Programming Considerations
Setting Options Programmatically for the Excel Driver
Microsoft Excel Data Types
SQLGetInfo Returned Values for Excel
Other Excel Driver Programming Details
Paradox Driver Programming Considerations
Setting Options Programmatically for the Paradox Driver
Paradox Data Types
SQLGetInfo Returned Values for Paradox
Other Paradox Driver Programming Details
dBASE Driver Programming Considerations
Setting Options Programmatically for the dBASE Driver
dBASE Data Types
SQLGetInfo Returned Values for dBASE
Other dBASE Driver Programming Details
Text File Driver Programming Considerations
Setting Options Programmatically for the Text File Driver
Text File Data Types
SQLGetInfo Returned Values for Text Files
Other Text File Driver Programming Details
Additional Supported ODBC SQL Grammar
ALTER TABLE Statement
Correlation Names
Procedure Invocation
BETWEEN Predicate
CREATE INDEX Statement
Date Arithmetic
Jet: Date, Time, and Timestamp Literals
DROP INDEX Statement
Fixed-Width Text File
GROUP BY expression-list
ORDER BY expression-list
ORDER BY with GROUP BY
Jet: Outer Joins
Scalar Functions
Table Names
Limitations
Aggregate Function Limitations
Column Name Limitations
Data Type Limitations
Date Arithmetic Limitations
Identifiers Limitations
Index Name Limitations
Parameterized Query Limitations
Reserved Word Limitations
Scalar Function Limitations
Set Functions Limitations
Sorting Limitations
String Limitations
Table Name Limitations
Table References Limitations
Views Limitations
ALTER TABLE Statement Limitations
AND Predicate Limitations
CALL Statement Limitations
CONVERT Function Limitations
CREATE INDEX Statement Limitations
CREATE TABLE Statement Limitations
DISTINCT Keyword Limitations
DROP INDEX Statement Limitations
DROP TABLE Statement Limitations
FROM Clause Limitations
HAVING Clause Limitations
INSERT Statement Limitations
LIKE Predicate Limitations
NOT NULL Limitations
ORDER BY Clause Limitations
SELECT DISTINCT Limitations
SELECT Statement Limitations
UPDATE Statement Limitations
WHERE Clause Limitations
WHERE CURRENT OF Clause Limitations
ODBC Errors
Native Error
SQLSTATE
ODBC Jet Error Messages
Arithmetic Errors
Supported ODBC API Functions
SQLGetCursorName (Desktop Database Drivers)
SQLGetData (Desktop Database Drivers)
SQLGetStmtOption (Desktop Database Drivers)
SQLMoreResults (Desktop Database Drivers)
SQLPrepare (Desktop Database Drivers)
SQLProcedures (Desktop Database Drivers)
SQLSetCursorName (Desktop Database Drivers)
SQLSetPos (Desktop Database Drivers)
SQLSetScrollOptions (Desktop Database Drivers)
SQLSetStmtOption (Desktop Database Drivers)
SQLSpecialColumns (Desktop Database Drivers)
ODBC Driver for Oracle
ODBC Driver for Oracle User's Guide
Driver Version Scheme
Installing the Software (ODBC)
Oracle Software Patches
Adding and Modifying Data Sources Using Setup
Testing the ODBC Connection
Configuring the ODBC Driver for Oracle
Connecting to a Data Source (ODBC Driver for Oracle)
Determining Installed Oracle Components
Setting the Date Format on Connection
ODBC Driver for Oracle Programmer's Reference
Connection String Format and Attributes
Connect Options
Statement Options
Cursor Type and Concurrency Combinations
Using Microsoft Component Services
Using Microsoft Internet Information Services
Using Operating System Authentication
Using SQLConfigDatasource with the ODBC Driver for Oracle
Limitations of Using Keyset-Driven Cursors
Stored Procedures (ODBC Driver for Oracle)
Error Messages (ODBC Driver for Oracle)
ODBC Driver for Oracle Conformance Levels
API Functions (ODBC Driver for Oracle)
Supported Data Types (ODBC Driver for Oracle)
Mapping Data Types (ODBC Driver for Oracle)
VARCHAR Column Size (ODBC Driver for Oracle)
Visual FoxPro ODBC Driver
Driver Architecture Overview
Visual FoxPro Terminology
Installing and Configuring
System Requirements (Visual FoxPro ODBC Driver)
Supported Versions of FoxPro
Setting Up the Visual FoxPro ODBC Driver
ODBC Visual FoxPro Setup Dialog Box
Using the Visual FoxPro ODBC Driver
Adding a Visual FoxPro Data Source
Modifying a Visual FoxPro Data Source
Deleting a Visual FoxPro Data Source
Connecting to a Visual FoxPro Data Source
Using Connection Strings
Using the VFP FoxPro ODBC Driver with Your Visual Basic Application
Using the Visual FoxPro ODBC Driver with Your C or Visual C++ Application
Accessing Visual FoxPro Data from Microsoft Office
Visual FoxPro ODBC Driver Programmer's Reference
Bookmark Support (Visual FoxPro ODBC Driver)
Supported Concurrency Model (Visual FoxPro ODBC Driver)
Supported Cursor Model (Visual FoxPro ODBC Driver)
Supported Data Types (Visual FoxPro ODBC Driver)
International Support (Visual FoxPro ODBC Driver)
Support for Rules, Triggers, Default Values, and Stored Procedures (Visual FoxPro
ODBC Driver)
Supported ODBC SQL Grammar (Visual FoxPro ODBC Driver)
Registry Entries (Visual FoxPro ODBC Driver)
Supported Scalar Functions (Visual FoxPro ODBC Driver)
Supported SET Commands (Visual FoxPro ODBC Driver)
Thread Support (Visual FoxPro ODBC Driver)
Unsupported Visual FoxPro Commands and Functions (Visual FoxPro ODBC Driver)
Error Messages (Visual FoxPro ODBC Driver)
Troubleshooting (Visual FoxPro ODBC Driver)
ODBC Functions and the Visual FoxPro ODBC Driver
SQLAllocConnect (Visual FoxPro ODBC Driver)
SQLAllocEnv (Visual FoxPro ODBC Driver)
SQLAllocStmt (Visual FoxPro ODBC Driver)
SQLBindCol (Visual FoxPro ODBC Driver)
SQLBindParameter (Visual FoxPro ODBC Driver)
SQLCancel (Visual FoxPro ODBC Driver)
SQLColAttributes (Visual FoxPro ODBC Driver)
SQLColumns (Visual FoxPro ODBC Driver)
SQLConnect (Visual FoxPro ODBC Driver)
SQLDataSources (Visual FoxPro ODBC Driver)
SQLDescribeCol (Visual FoxPro ODBC Driver)
SQLDisconnect (Visual FoxPro ODBC Driver)
SQLDriverConnect (Visual FoxPro ODBC Driver)
SQLDrivers (Visual FoxPro ODBC Driver)
SQLError (Visual FoxPro ODBC Driver)
SQLExecDirect (Visual FoxPro ODBC Driver)
SQLExecute (Visual FoxPro ODBC Driver)
SQLExtendedFetch (Visual FoxPro ODBC Driver)
SQLFetch (Visual FoxPro ODBC Driver)
SQLFreeConnect (Visual FoxPro ODBC Driver)
SQLFreeEnv (Visual FoxPro ODBC Driver)
SQLFreeStmt (Visual FoxPro ODBC Driver)
SQLGetConnectOption (Visual FoxPro ODBC Driver)
SQLGetCursorName (Visual FoxPro ODBC Driver)
SQLGetData (Visual FoxPro ODBC Driver)
SQLGetFunctions (Visual FoxPro ODBC Driver)
SQLGetInfo (Visual FoxPro ODBC Driver)
SQLGetStmtOption (Visual FoxPro ODBC Driver)
SQLGetTypeInfo (Visual FoxPro ODBC Driver)
SQLMoreResults (Visual FoxPro ODBC Driver)
SQLNumParams (Visual FoxPro ODBC Driver)
SQLNumResultCols (Visual FoxPro ODBC Driver)
SQLParamData (Visual FoxPro ODBC Driver)
SQLParamOptions (Visual FoxPro ODBC Driver)
SQLPrepare (Visual FoxPro ODBC Driver)
SQLPrimaryKeys (Visual FoxPro ODBC Driver)
SQLPutData (Visual FoxPro ODBC Driver)
SQL Row Count (Visual FoxPro ODBC Driver)
SQLSetConnectOption (Visual FoxPro ODBC Driver)
SQLSetCursorName (Visual FoxPro ODBC Driver)
SQLSetPos (Visual FoxPro ODBC Driver)
SQLSetScrollOptions (Visual FoxPro ODBC Driver)
SQLSetStmtOption (Visual FoxPro ODBC Driver)
SQLSpecialColumns (Visual FoxPro ODBC Driver)
SQLStatistics (Visual FoxPro ODBC Driver)
SQLTables (Visual FoxPro ODBC Driver)
SQLTransact (Visual FoxPro ODBC Driver)
Visual FoxPro Language Reference
ALTER TABLE - SQL Command
CREATE TABLE - SQL Command
DELETE - SQL Command
DELETE TAG Command
DROP TABLE Command
INDEX Command
INSERT - SQL Command
SELECT - SQL Command
SET ANSI Command
SET BLOCKSIZE Command
SET COLLATE Command
SET DELETED Command
SET EXACT Command
SET EXCLUSIVE Command
SET NULL Command
SET PATH Command
SET REPROCESS Command
SET UNIQUE Command
UPDATE - SQL Command
Visual FoxPro Field Data Types
Microsoft-Supplied ODBC Drivers
12/20/2017 • 1 min to read • Edit Online

Drivers are libraries that implement the functions in the ODBC API. Each driver is specific to a particular database
management system (DBMS ). In most cases, drivers expose the capabilities of the underlying DBMS; they are not
required to implement capabilities not supported by the DBMS. Drivers perform specific tasks and can be classified
into two categories: file-based and DBMS -based. For more information about drivers and driver architecture, see
Drivers.
This section contains the following topics.
Using 16-Bit and 32-Bit Applications with 32-Bit Drivers
Microsoft ODBC Desktop Database Drivers
ODBC Driver for Oracle
Visual FoxPro ODBC Driver
Using 16-Bit and 32-Bit Applications with 32-Bit
Drivers
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
16-bit application support will be removed in a future version of Windows. Avoid using this feature in new development
work, and plan to modify applications that currently use this feature. Develop 32-bit or 64-bit applications instead.

With the ODBC data access component, you can use 16-bit and 32-bit applications with 32-bit drivers. The
Microsoft® Windows® 95/98 and Microsoft Windows NT®/Windows 2000 operating systems support the
following combinations of applications and drivers:
16-bit applications with 32-bit drivers
32-bit applications with 32-bit drivers
Using a 32-bit application with a 16-bit driver is not supported.

NOTE
Beginning with the release of ODBC version 3.0, Windows NT 4.0 has been supported.

ODBC includes the ODBC components necessary to support the above configurations by "thunking" dynamic-link
libraries (DLLs) to convert 16-bit addresses to 32-bit addresses and vice versa. The Setup program determines
which operating system you are using and installs ODBC components required by that system. You can also
choose to install the ODBC components used by all systems.
In most cases, porting an application or driver from 16-bit to 32-bit involves five types of changes:
Changes to message-handling code
Changes because integers and handles are 32 bits
Changes in calls to Windows application programming interfaces (APIs)
Changes to make the driver thread-safe
Changes to ODBC components
From an application or driver programming standpoint, the major difference between 16-bit and 32-bit
ODBC components is that they have different file names. From a system standpoint, the architecture of each
application or driver connection is different and the tools used to manage data sources are different.
This section contains the following topics.
Using 16-Bit Applications with 32-Bit Drivers
Using 32-Bit Applications with 32-Bit Drivers
Using 16-Bit Applications with 32-Bit Drivers
12/20/2017 • 2 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work and plan to
modify applications that currently use this feature. Use 32-bit or 64-bit driver manager instead.

You can run 16-bit applications with 32-bit drivers on your Windows-based system as long as the 32-bit driver
does not explicitly call Win32 API functions that create threads. The Windows on Windows (WOW ) subsystem
runs the applications in 16-bit mode and resolves 16-bit calls to the operating system. ODBC thunking DLLs
resolve 16-bit calls from the application to 32-bit drivers. The 16-bit applications use the Windows API, and 32-bit
drivers use the Win32 API.

Architecture
The following illustration shows how 16-bit applications communicate with 32-bit drivers. Between the 16-bit
Driver Manager and the 32-bit drivers are generic thunking DLLs that convert 16-bit ODBC calls to 32-bit ODBC
calls.

NOTE
Anytime a 16-bit application interacts with a 32-bit driver, the 32-bit Driver Manager always returns "2.0" as the version of
ODBC supported by the driver.

Administration
You can manage data sources for 32-bit drivers by using the ODBC Data Source Administrator. To open the ODBC
Administrator on computers running Microsoft® Windows® 2000, open the Windows Control Panel, double-click
Administrative Tools, and then double-click Data Sources (ODBC ). On computers running previous versions of
Microsoft Windows, the icon is named 32-bit ODBC or simply ODBC.
The following illustration shows how a 16-bit application calls a 32-bit driver setup DLL. Between the 16-bit
installer DLL and the 32-bit driver setup DLL is a generic thunking DLL that converts 16-bit installer DLL calls to
32-bit installer DLL calls.

In Windows on Windows (16-bit to 32-bit thunking), an additional thunking DLL named Ds32gt.dll converts 16-
bit argument values passed through a 32-bit setup DLL back to 16-bit.

Components
The ODBC component of the MDAC 2.8 SP1 SDK includes the following files for running 16-bit applications with
32-bit drivers. These components are in the \Redist directory.

FILE NAME DESCRIPTION

Odbc16gt.dll 16-bit ODBC generic thunking DLL

Odbc32gt.dll 32-bit ODBC generic thunking DLL

Odbccp32.dll 32-bit installer DLL

Odbcad32.exe 32-bit Administrator program

Odbcinst.hlp Installer Help file

Ds16gt.dll 16-bit driver setup generic thunking DLL

Ctl3d32.dll 32-bit three-dimensional window style library

In addition, the following files along with the 16-bit ODBC 2.10 Driver Manager, which are not part of ODBC 3.51,
are required by and should be installed with the 16-bit application.

FILE NAME DESCRIPTION

Odbc.dll 16-bit Driver Manager

Odbcinst.dll 16-bit Installer DLL

Odbcadm.exe 16-bit ODBC Administrator program


Using 32-Bit Applications with 32-Bit Drivers
12/20/2017 • 1 min to read • Edit Online

You can run 32-bit applications with 32-bit drivers. The 32-bit applications and the 32-bit drivers use the Win32®
API.

Architecture
The following illustration shows how 32-bit applications communicate with 32-bit drivers. The application calls the
32-bit Driver Manager, which in turn calls 32-bit drivers.

IMPORTANT
Do not use the 32-bit thunking installer DLL on WindowsNT/Windows2000. Although it has the same file name as the 32-bit
installer DLL, it is a different DLL.

Administration
You can manage data sources for 32-bit drivers by using the ODBC Data Source Administrator. To open the ODBC
Administrator on computers running Windows 2000, open the Windows Control Panel, double-click
Administrative Tools, and then double-click Data Sources (ODBC ). On computers running previous versions of
Microsoft Windows, the icon is named 32-bit ODBC or simply ODBC.

Components
The ODBC component includes the following files for running 32-bit applications with 32-bit drivers. These
components are in the \Redist directory.

FILE NAME DESCRIPTION

Odbc32.dll 32-bit Driver Manager

Odbccp32.dll 32-bit Installer DLL

Odbcad32.exe 32-bit ODBC Administrator program

Odbcinst.hlp Installer Help file


FILE NAME DESCRIPTION

Msvcrt40.dll C run-time library


Microsoft ODBC Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

ODBC is an API that uses Structured Query Language (SQL ) as the database access language. You can access a
wide variety of database management systems (DBMSs) with the same ODBC source code that is directly
incorporated into an application's source code. With the Microsoft ODBC Desktop Database Drivers, a user of an
ODBC -enabled application can open, query, and update a desktop database through the ODBC interface.
The Microsoft ODBC Desktop Database Drivers are a Microsoft Jet-based set of ODBC drivers. Whereas Microsoft
ODBC Desktop Database Drivers 2.0 include both 16-bit and 32-bit drivers, versions 3.0 and later include only 32-
bit drivers that work on Windows 95 or later, Windows NT Workstation or Server version 4.0, Windows 2000
Professional, or Windows 2000 Server. These drivers provide access to the following types of data sources:
Microsoft Access
Microsoft Excel
Paradox
dBASE
Text
See Visual FoxPro ODBC Driver for detailed documentation about the Microsoft Visual FoxPro® ODBC
Driver.

NOTE
Access to other data sources, such as Lotus 1-2-3, Microsoft Exchange, and HTML, is enabled by installable ISAM (IISAM)
drivers. For more information about these drivers, see "Accessing External Data" in the Microsoft Jet Database Engine
Programmer's Reference. ODBC Desktop Database Drivers 4.0 do not support Btrieve and EMS data formats.

This section contains the following topics.


Desktop Database Drivers Architecture
History of the Desktop Database Drivers
Product Support
Implementing Desktop Database Drivers
Microsoft Access Driver Programming Considerations
Microsoft Excel Driver Programming Considerations
Paradox Driver Programming Considerations
dBASE Driver Programming Considerations
Text File Driver Programming Considerations
Additional Supported ODBC SQL Grammar
Limitations
ODBC Errors
Supported ODBC API Functions
Desktop Database Drivers Architecture
12/20/2017 • 2 min to read • Edit Online

These drivers are designed for use on Microsoft Windows 95 or later, or Windows NT 4.0 and Windows 2000.
Only 32-bit applications are supported on Windows 95 or later; 16-bit and 32-bit applications are supported on
Windows NT 4.0 and Windows 2000.

NOTE
For information about the version of ODBC to be used with these drivers, refer to the ODBC Programmer's Reference, and
past and current release notes. Except for noted areas, these drivers conform to the ODBC Programmer's Reference.

The ODBC Desktop Database Drivers include 32-bit drivers for Microsoft Access, dBASE, Microsoft Excel, Paradox,
and Text. No 16-bit drivers are included. (A driver for Microsoft FoxPro is available separately.)
The application/driver architecture on Windows 95 or later is:

The use of these drivers by 16-bit applications on Windows 95 is not supported.


The application/driver architecture on Windows NT 4.0 and Windows 2000 is:
The Desktop Database Drivers are two-tier drivers. In a two-tier configuration, the driver does not perform the
process of parsing, validating, optimizing, and executing the query. Instead, Microsoft Jet performs these tasks. It
processes ODBC API calls and acts as an SQL engine. Microsoft Jet has become an integral, inseparable part of
the drivers: It is shipped with the drivers and resides with the drivers, even if no other application on the computer
uses it.
The Desktop Database Drivers consist of six different drivers — or, more precisely, one driver file (Odbcjt32.dll)
that the ODBC Driver Manager uses in six different ways. The DRIVERID flag in the registry entry for a data
source determines which driver in Odbcjt32.dll the Driver Manager uses. An application passes this flag in the
connection string included in a call to SQLDriverConnect. By default, the flag is the ID of the Microsoft Access
driver.
The driver setup file changes the DRIVERID flag at setup time. All drivers except the Microsoft Access driver have
an associated setup DLL. When you click Setup in the Microsoft ODBC Data Source Administrator for a data
source, the ODBC installer DLL (Odbcinst.dll) loads the setup DLL. The setup DLL exports the ODBC installer
function SQLConfigDataSource. If a window handle is passed to SQLConfigDataSource, this function displays
a setup window and changes the DRIVERID flag according to the driver selected from the user interface.
When a file is created programmatically, a NULL window handle is passed to SQLConfigDataSource, and the
function creates a data source dynamically, changing the DRIVERID flag according to the lpszDriver argument in
the function call.
Odbcjt32.dll implements ODBC functions on top of the Microsoft Jet API. There is no direct mapping between
ODBC and Microsoft Jet functions, however. Many factors, such as the cursor models and SQL mapping, prevent a
direct correlation of the functions.
The ODBC driver resides between the Microsoft Jet engine and the ODBC Driver Manager. Some ODBC functions
called by an application are handled by the Driver Manager and not passed to the driver. For these functions,
Microsoft Jet never sees the function call because it does not have a direct connection to the Driver Manager.
History of the Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

The following table shows the Desktop Database Drivers version history.

VERSION RELEASE DATE DESCRIPTION

1.0 August 1993 Used the SIMBA query processor


produced by PageAhead Software.
SIMBA received ODBC calls and SQL
statements, processed them into
Microsoft Jet installable ISAM calls, and
then called the Microsoft Jet ISAM
dispatch layer to load and call the
appropriate installable ISAM driver.

2.0 December 1994 Used with ODBC 2.0, which significantly


expanded ODBC functionality. The
major change in version 2.0 was that
the Microsoft Jet database engine
replaced the SIMBA query processor.
With the Microsoft Jet database engine,
the Desktop Database Drivers
integrated much more tightly with the
Microsoft Jet installable ISAM drivers
and Microsoft Access technology.
Significant enhancements were:

- Native support for scrollable cursors.


- Native support for outer joins,
updatable and heterogeneous joins, and
transactions.
- 32-bit versions of the drivers for
Microsoft Windows NT.

3.0 October 1995 Provided support for Windows 95 and


Windows NT Workstation or NT Server
3.51. Only 32-bit drivers were included
in this release; the 16-bit drivers for
Windows version 3.1 were removed.

3.5 October 1996 These drivers were double-byte


character set (DBCS)-enabled, were
better suited for use with Internet
applications than previous versions, and
accommodated the use of File data
source names (DSNs). The Microsoft
Access driver was released in an RISC
version for use on Alpha platforms for
Windows 95/98 and Windows NT 3.51
and later operating systems.

4.0 Late 1998 Provides support for Microsoft Jet


Engine Unicode format along with
compatibility for ANSI format of earlier
versions.
NOTE
The version3.5 drivers were designed to work with ODBC2.x. Although they also work with ODBC 3.0, they do not support
all ODBC 3.0 features. For more information about how these drivers work with ODBC 3.0, see Backward Compatibility and
Standards Compliance.
Product Support
12/20/2017 • 1 min to read • Edit Online

Product support for ODBC is provided by Microsoft Product Support Services. Because many Microsoft products
use ODBC as a core component and also redistribute ODBC drivers, Microsoft Product Support Services
considers ODBC to be a part of each product that incorporates ODBC as a component. Support for ODBC is
provided in accordance with the support agreement of that product. See the individual product documentation for
more information.
Implementing Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

Instructions and technical notes about how to implement and set up the Microsoft ODBC Desktop Database
Drivers can be found in the ODBC Data Source Administrator online help. This file can be accessed during driver
setup routines from the Microsoft ODBC Data Source Administrator.
This section contains the following topics.
Files to Use with the Desktop Database Drivers
ODBC Component Files
Hardware and Software Requirements
Descriptors with Desktop Database Drivers
Diagnostics for Desktop Database Drivers
Functions Accepting String Parameters
SQL -92 Compliance
Base Address of Drivers
Setup DLL
Translation DLLs and Desktop Database Drivers
Desktop Database Driver Compatibility
Desktop Database Driver Performance Issues
Files to Use with the Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

The ODBC Desktop Database Drivers are used with the Microsoft Jet Database Engine, the installable ISAM files,
and Microsoft ODBC files. Not all are required for the redistribution of the product, and not all are core
components.

FOR INFORMATION ABOUT SEE

Files used by each Desktop Database Driver ODBC Driver Files

Microsoft Jet files used by each Desktop Database Driver Microsoft Jet Files

IISAM driver files that provide data access between Microsoft Installable ISAM Driver Files
Jet and the other DBMS
ODBC Component Files
12/20/2017 • 1 min to read • Edit Online

The ODBC Driver files are required by each component of ODBC Desktop Database Drivers 4.0.
Some files are required by more than one component. These files must be redistributed if you intend to
redistribute any of the ODBC Desktop Database Drivers with your commercial applications.
These files are installed in the \Windows\System directory for Windows 95 or later, or in the \Windows\System32
directory for Windows NT 3.51 or later and Windows 2000. If ODBC files were previously installed in a different
directory, make sure that you use the newer files in the \Windows\System (or System32) directory.
Hardware and Software Requirements (ODBC)
12/20/2017 • 1 min to read • Edit Online

This topic lists requirements for using the ODBC Desktop Database Drivers.

Hardware Requirements
To use the ODBC Desktop Database Drivers, you must have:
An IBM -compatible personal computer.
A hard disk with 6 MB of free disk space.
At least 16 MB of random-access memory (RAM ).

Software Requirements
To access data with an ODBC driver, you must have:
The ODBC driver.
The 32-bit ODBC Driver Manager, version 3.51 or later (Odbc32.dll).
Microsoft Windows 95 or later, or Windows NT 4.0 or Windows 2000.
A stack size of at least 20 KB for an application using a Microsoft ODBC driver.
When using Microsoft Windows NT 4.0 or Windows 2000, the 32-bit driver is thread-safe, but only through
the use of a global semaphore that controls access to the driver. Concurrent use of the driver is very limited
under Windows NT. All access to the Jet ISAM layer will be single-threaded for all applications using the
Microsoft Jet engine.
When running multiple 16-bit applications on Windows on Windows (WOW ) on Microsoft Windows NT
4.0, the applications must be run in separate memory spaces. (The same memory space cannot be used
because ODBC does not support multiple environments in the same process.) To run an application in a
separate memory space, select the application's icon in the Program Manager, open the File menu and click
Properties, and then click Run In Separate Memory Space.
The use of these drivers by 16-bit applications on Windows 95 is not supported.

Driver-Specific Hardware and Software Requirements


The MicrosoftAccess and dBASEdrivers may require changes in the Autoexec.bat or Config.sys files.
Descriptors and Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

A descriptor is a data structure that holds information about either column data or dynamic parameters.
SQLGetDescField can be used to retrieve the supported descriptors listed below. Implementation Parameter
Descriptors (IPD ) are not automatically populated because SQLDescribeParam is not supported. Descriptor
fields that are not available through Jet (such as SQL_DESC_BASE_TABLE_NAME ) are also not supported.
For more information about Jet-supported descriptor fields, see the Microsoft Jet Database Engine Programmer's
Guide.
For more information about descriptors, see the topics under "Descriptors" in the ODBC Programmer's Reference.

DESCRIPTOR FIELDS SUPPORT LEVEL

SQL_DESC_ALLOC_TYPE Supported

SQL_DESC_ARRAY_SIZE Supported only for ARD

SQL_DESC_ARRAY_STATUS_PTR Supported

SQL_DESC_BIND_OFFSET_PTR Supported

SQL_DESC_BIND_TYPE Supported

SQL_DESC_COUNT Supported

SQL_DESC_ROWS_PROCESSED_PTR Supported only for ARD

SQL_DESC_AUTO_UNIQUE_VALUE Supported

SQL_DESC_BASE_COLUMN_NAME Supported (NEW)

SQL_DESC_BASE_TABLE_NAME Supported (NEW)

SQL_DESC_CASE_SENSITIVE Always FALSE

SQL_DESC_CATALOG_NAME Not supported

SQL_DESC_CONCISE_TYPE Supported

SQL_DESC_DATA_PTR Supported

SQL_DESC_DATETIME_INTERVAL_CODE Supported

SQL_DESC_DATETIME_INTERVAL_PRECISION Supported for INTERVAL C types

SQL_DESC_DISPLAY_SIZE Supported

SQL_DESC_FIXED_PREC_SCALE Supported (TRUE for money)


DESCRIPTOR FIELDS SUPPORT LEVEL

SQL_DESC_INDICATOR_PTR Supported

SQL_DESC_LABEL Supported

SQL_DESC_LENGTH Supported

SQL_DESC_LITERAL_PREFIX Supported

SQL_DESC_LITERAL_SUFFIX Supported

SQL_DESC_LOCAL_TYPE_NAME Not supported (returns EMPTY string)

SQL_DESC_NAME Supported

SQL_DESC_NULLABLE Supported

Note Unsupported in versions preceding Jet 4.0

SQL_DESC_NUM_PREC_RADIX Supported

SQL_DESC_OCTET_LENGTH Supported

SQL_DESC_OCTET_LENGTH_PTR Supported

SQL_DESC_PARAMETER_TYPE Only input parameters

SQL_DESC_PRECISION Supported

SQL_DESC_SCALE Supported

SQL_DESC_SCHEMA_NAME Not supported

SQL_DESC_SEARCHABLE Supported

SQL_DESC_TABLE_NAME Not supported

SQL_DESC_TYPE Supported

SQL_DESC_TYPE_NAME Supported

SQL_DESC_UNNAMED Supported

SQL_DESC_UNSIGNED Supported

SQL_DESC_UPDATABLE Supported
Diagnostics for Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

All errors and warnings not checked or partially checked by the Driver Manager are handled by the driver. The
driver also maps native errors, or errors returned by the data source, to SQLSTATEs. Each function listed in the
ODBC Programmer's Reference contains a "Diagnostics" section that specifies conditions and messages.
Applications call SQLGetDiagRec to retrieve SQLSTATE, native error code, and diagnostic messages. Calling
SQLGetDiagField and specifying the field retrieves individual diagnostic fields. The support level of the
diagnostic identifiers is listed in the following table.

DIAGIDENTIFIERS SUPPORT LEVEL

SQL_DIA_DYNAMIC_FUNCTION Not supported

SQL_DIAG_CLASS_ORIGIN Supported. Always "ODBC 3.0" for versions 3.0 and later of
this driver.

SQL_DIAG_COLUMN_NUMBER Supported

SQL_DIAG_CURSOR_ROW_COUNT Not supported

SQL_DIAG_DYNAMIC_FUNCTION_CODE Not supported

SQL_DIAG_MESSAGE_TEXT Supported

SQL_DIAG_NATIVE Supported

SQL_DIAG_NUMBER Supported

SQL_DIAG_RETURNCODE Supported but implemented by the Driver Manager

SQL_DIAG_ROW_COUNT Supported

SQL_DIAG_ROW_NUMBER Supported

SQL_DIAG_SERVER_NAME Not supported

SQL_DIAG_SQLSTATE Supported

SQL_DIAG_SUBCLASS_ORIGIN Supported
Functions Accepting String Parameters
12/20/2017 • 1 min to read • Edit Online

All functions that take string parameters will be converted to Unicode. (The "W" form of the function will be
exported.) Count of bytes is converted to count of characters for those applicable ODBC APIs. This applies to the
following functions:
SQLConnect
SQLDriverConnect
SQLColAttributes
SQLDescribeCol
SQLError (replaced by SQLGetDiagField)
SQLExecDirect
SQLGetCursorName
SQLSetCursorName
SQLGetStmtAttr
SQLGetInfo
SQLGetStmtOption (becomes SQLGetStmtAttr)
SQLSetStmtOption (becomes SQLSetStmtAttr)
SQLGetConnectOption
SQLSetConnectOption
SQLGetTypeInfo
SQLStatistics
SQLTables
SQLNativeSQL
SQLSpecialColumns
ConfigDSNEx
ConfigDSN
SQL-92 Compliance
12/20/2017 • 1 min to read • Edit Online

The ODBC Desktop Database Drivers and the underlying Microsoft Jet engine are not SQL -92 compliant. They
support many features that have been defined in SQL -92. Some features supported in the driver are not
supported in SQL -92. For more information, see the Microsoft Jet Database Engine Programmer's Guide. The
following are the major differences between the two:
The SQL used by the Desktop Database Drivers supports more powerful expressions than those specified
by SQL -92.
Different rules apply to the BETWEEN predicate.
The SQL used by the Desktop Database Drivers and ANSI SQL supports different keywords.
The following SQL -92 features are not supported by Microsoft Jet SQL:
Security statements, such as GRANT and LOCK.
DISTINCT with aggregate function references.
The following features are enhancements in the SQL used by the Desktop Database Drivers that are not
specified by SQL -92:
The TRANSFORM statement providing support for crosstab queries.
Additional aggregate functions (StDev and VarP ).

NOTE
The Desktop Database Drivers support the standard ANSI syntax for % (percent) and _ (underscore), not * (asterisk) and ?
(question mark).
Base Address of Drivers
12/20/2017 • 1 min to read • Edit Online

Each of the ODBC Desktop Database Drivers has been linked with a base address of 0x04c0000.
Setup DLL
12/20/2017 • 1 min to read • Edit Online

The ODBC Administrator calls the function ConfigDSN when users configure data sources.
Translation DLLs and Desktop Database Drivers
12/20/2017 • 1 min to read • Edit Online

Not supported.
Desktop Database Driver Compatibility
12/20/2017 • 1 min to read • Edit Online

Unicode is a method of software character encoding that treats all characters as having a fixed width of two bytes.
This method is used as an alternative to Windows ANSI character encoding, which, because it represents
characters in one byte, is limited to 256 characters. Because Unicode can represent over 65,000 characters, it
accommodates many languages whose characters are not represented in ANSI encoding.
The ODBC 3.5 (or later) Driver Manager is Unicode-enabled. This affects two major areas: function calls and string
data types. The Driver Manager maps function string arguments and string data as required by the application and
driver, both of which can be either Unicode-enabled or ANSI-enabled.
The ODBC 3.5 (or later) Driver Manager supports the use of a Unicode driver with both a Unicode application and
an ANSI application. It also supports the use of an ANSI driver with an ANSI application. The Driver Manager
provides limited Unicode-to-ANSI mapping for a Unicode application working with an ANSI driver. This allows
access to the Jet 3.5 databases and support of all existing ISAM file types.
When an ANSI application uses the ODBC Desktop Database Driver 4.0 and accesses Microsoft Access 4.0 or
later, the driver exposes the data type as SQL_CHAR, SQL_VARCHAR, or SQL_LONGVARCHAR even though Jet
4.0 supports the wide version. Older versions of Jet do not support SQL_WCHAR, SQL_WVARCHAR, and
SQL_WLONGVARCHAR. This restriction also applies in cases where the old formats are used with the Jet 4.0
Database Engine.
For more information concerning Unicode issues with ODBC, see Unicode in Programming Considerations.
Desktop Database Driver Performance Issues
12/20/2017 • 2 min to read • Edit Online

To ensure compatibility with existing ANSI applications, the SQL_WCHAR, SQL_WVARCHAR, and
SQL_WLONGVARCHAR data types are exposed as SQL_CHAR, SQL_VARCHAR, and SQL_LONGVARCHAR for
Microsoft Access 4.0 or higher data sources. The data sources do not return WIDE CHAR data types but the data
still must be sent to Jet in Wide Char form. It is important to understand that conversion will take place if a
SQL_C_CHAR parameter or result column is bound to a SQL_CHAR data type in an ANSI application.
This conversion can be especially inefficient in terms of memory when a SQL_C_CHAR type is bound to a
parameter of type LONGVARCHAR. Since the Jet 4.0 engine is unable to stream LONGTEXT parameter data, a
UNICODE conversion buffer must be allocated that is twice the size of the SQL_C_CHAR ANSI buffer. The most
efficient mechanism is for the application to perform the UNICODE conversion and bind the parameter as type
SQL_C_WCHAR. When a parameter is marked as data-at-execution and the data is supplied in multiple calls to
SQLPutData, a longtext data buffer is grown. One way to avoid the expense of growing this "Put Data" buffer is to
supply an optional length via SQL_DATA_AT_EXEC_LEN (x), where x is the expected length of bytes. This will
initialize the size of an internal PutData buffer to x bytes.

NOTE
An efficient way to insert or update long data can be accomplished using SQLBulkOperations() or SQLSetPos() and setting
the long data to SQL_DATA_AT_EXEC. (EXEC_LEN is ignored in this case.) Data can be streamed in chunks by calling
SQLPutData multiple times, which will effectively append the data to the table.

When an application using a Jet 3.5 database through the Microsoft ODBC Desktop Database Drivers is upgraded
to version 4.0, some performance degradation and an increased working set size may occur. This is because when a
version 3.x database is opened using the new version 4.0 driver, it loads Jet 4.0. When Jet 4.0 opens the database
and sees that the database is a 3.x version, it loads an Installable ISAM driver that is equivalent to loading the Jet
3.5 engine as well. To remove the performance and size penalty, the Jet 3.x database should be compacted into a
Jet 4.0 format database. This will eliminate loading two Jet engines and minimize the code path to the data.
Also, the Jet 4.0 engine is a Unicode engine. All strings are stored and manipulated in Unicode. When an ANSI
application accesses a Jet 3.x database through the Jet 4.0 engine, the data is converted from ANSI to Unicode and
back to ANSI. If the database is updated to the version 4.0 format, the strings are converted to Unicode, removing
one level of string conversion as well as minimizing the code path to the data by going through only one Jet
engine.
Microsoft Access Driver Programming Considerations
12/20/2017 • 1 min to read • Edit Online

This section contains the following topics.


Setting Options Programmatically for the Access Driver
Microsoft Access Data Types
SQLGetInfo Returned Values for Access
Other Access Driver Programming Details
Setting Options Programmatically for the Access
Driver
12/20/2017 • 3 min to read • Edit Online

OPTION DESCRIPTION METHOD

Buffer Size The size of the internal buffer, in To set this option dynamically, use the
kilobytes, that is used by Microsoft MAXBUFFERSIZE keyword in a call to
Access to transfer data to and from the SQLConfigDataSource.
disk. The default buffer size is 2048 KB
(displayed as 2048). Any integer value
divisible by 256 can be entered.

Data Source Name A name that identifies the data source, To set this option dynamically, use the
such as Payroll or Personnel. DSN keyword in a call to
SQLConfigDataSource.

Database A Microsoft Access data source can be To set this option dynamically, use the
set up without selecting or creating a DBQ keyword in a call to
database. If no database is provided SQLConfigDataSource.
upon setup, the user will be prompted
to choose a database file when
connecting to the data source.

Description An optional description of the data in To set this option dynamically, use the
the data source; for example, "Hire date, DESCRIPTION keyword in a call to
salary history, and current review of all SQLConfigDataSource.
employees."

Exclusive If the Exclusive box is selected, the To set this option dynamically, use the
database will be opened in Exclusive EXCLUSIVE keyword in a call to
mode and can be accessed by only one SQLConfigDataSource.
user at a time. Performance is enhanced
when running in Exclusive mode.

ImplicitCommitSync Determines how changes made outside This option is included in the Set
of a transaction are written to the Advanced Options dialog box for the
database. This value is initially set to Microsoft Access driver.
"Yes", which means that the Microsoft
Access driver will wait for commits in an
internal/implicit transaction to be
completed.
OPTION DESCRIPTION METHOD

Page Timeout Specifies the period of time, in To set this option dynamically, use the
milliseconds, that a page (if not used) PAGETIMEOUT keyword in a call to
remains in the buffer before being SQLConfigDataSource.
removed. For the Microsoft Access
driver, the default is 500 milliseconds
(0.5 seconds). This option applies to all
data sources that use the ODBC driver.

The page timeout cannot be 0 because


of an inherent delay. The page timeout
cannot be less than the inherent delay,
even if the page timeout option is set
below that value.

Read Only Designates the database as read-only. To set this option dynamically, use the
READONLY keyword in a call to
SQLConfigDataSource.

System Database The full path of the Microsoft Access To set this option dynamically, use the
system database to be used with the SYSTEMDB keyword in a call to
Microsoft Access database you want to SQLConfigDataSource.
access.

Click the System Database button to


select the system database to be used.
The ODBC Microsoft Access driver
prompts the user for a name and
password. The default name is Admin
and the default password in Microsoft
Access for the Admin user is an empty
string.

To increase the security of your


Microsoft Access database, create a new
user to replace the Admin user and
delete the Admin user, or change the
objects to which the Admin user has
access.

Threads The number of background threads for To set this option dynamically, use the
the engine to use. For the Microsoft THREADS keyword in a call to
Access driver, this value defaults to 3, SQLConfigDataSource.
but can be changed. The user may want
to increase the number of threads if
there is a large amount of activity in the
database.

This option is included in the Set


Advanced Options dialog box for the
Microsoft Access driver.
OPTION DESCRIPTION METHOD

UserCommitSync Determines whether the Microsoft To set this option dynamically, use the
Access driver will perform an explicit USERCOMMITSYNC keyword in a call
user-defined transactions to SQLConfigDataSource.
asynchronously. This value is initially set
to "Yes", which means that the
Microsoft Access driver will wait for
commits in a user-defined transaction
to be completed.

Setting this option to False can have


unpredictable consequences in a multi-
user environment.
Microsoft Access Data Types
12/20/2017 • 2 min to read • Edit Online

The following table shows the Microsoft Access data types, data types used to create tables, and ODBC SQL data
types.

MICROSOFT ACCESS DATA TYPE DATA TYPE (CREATETABLE) ODBC SQL DATA TYPE

BIGBINARY[1] LONGBINARY SQL_LONGVARBINARY

BINARY BINARY SQL_BINARY

BIT BIT SQL_BIT

COUNTER COUNTER SQL_INTEGER

CURRENCY CURRENCY SQL_NUMERIC

DATE/TIME DATETIME SQL_TIMESTAMP

GUID GUID SQL_GUID

LONG BINARY LONGBINARY SQL_LONGVARBINARY

LONG TEXT LONGTEXT SQL_LONGVARCHAR[2]


SQL_WLONGVARCHAR[3]

MEMO LONGTEXT SQL_LONGVARCHAR[2]


SQL_WLONGVARCHAR[3]

NUMBER (FieldSize= SINGLE) SINGLE SQL_REAL

NUMBER (FieldSize= DOUBLE) DOUBLE SQL_DOUBLE

NUMBER (FieldSize= BYTE) UNSIGNED BYTE SQL_TINYINT

NUMBER (FieldSize= INTEGER) SHORT SQL_SMALLINT

NUMBER (FieldSize= LONG INTEGER) LONG SQL_INTEGER

NUMERIC NUMERIC SQL_NUMERIC

OLE LONGBINARY SQL_LONGVARBINARY

TEXT VARCHAR SQL_VARCHAR[1] SQL_WVARCHAR[2]

ARBINARY VARBINARY SQL_VARBINARY

[1] Access 4.0 applications only. Maximum length of 4000 bytes. Behavior similar to LONGBINARY.
[2] ANSI applications only.
[3] Unicode and Access 4.0 applications only.

NOTE
SQLGetTypeInfo returns ODBC data types. It will not return all Microsoft Access data types if more than one Microsoft
Access type is mapped to the same ODBC SQL data type. All conversions in Appendix D of the ODBC Programmer's
Reference are supported for the SQL data types listed in the previous table.

The following table shows limitations on Microsoft Access data types.

DATA TYPE DESCRIPTION

BINARY, VARBINARY, and VARCHAR Creating a BINARY, VARBINARY, or VARCHAR column of zero
or unspecified length actually returns a 510-byte column.

BYTE Even though a Microsoft Access NUMBER field with a FieldSize


equal to BYTE is unsigned, a negative number can be inserted
into the field when using the Microsoft Access driver.

CHAR, LONGVARCHAR, and VARCHAR A character string literal can contain any ANSI character (1-
255 decimal). Use two consecutive single quotation marks ('')
to represent one single quotation mark (').

Procedures should be used to pass character data when using


any special character in a character data type column.

DATE Date values must be either delimited according to the ODBC


canonical date format or delimited by the datetime delimiter
("#"). Otherwise, Microsoft Access will treat the value as an
arithmetic expression and will not raise a warning or error.

For example, the date "March 5, 1996" must be represented


as {d '1996-03-05'} or #03/05/1996#; otherwise, if only
03/05/1993 is submitted, Microsoft Access will evaluate this
as 3 divided by 5 divided by 1996. This value rounds up to the
integer 0, and since the zero day maps to 1899-12-31, this is
the date used.

A pipe character (|) cannot be used in a date value, even if


enclosed in back quotes.

GUID Data type limited to Microsoft Access 4.0.

NUMERIC Data type limited to Microsoft Access 4.0.

More limitations on data types can be found in Data Type Limitations.


SQLGetInfo Returned Values for Access
12/20/2017 • 2 min to read • Edit Online

The following table lists the C -language #defines for the fInfoType argument and the corresponding values
returned by SQLGetInfo. This information can be retrieved by passing the listed C -language #defines to
SQLGetInfo in the fInfoType argument. For more information about the values returned by SQLGetInfo, see the
ODBC Programmer's Reference.

NOTE
Where SQLGetInfo returns a 32-bit bitmask, a vertical bar (|) represents a bitwise OR.

INFOTYPE RETURNED VALUE

SQL_ACCESSIBLE_PROCEDURES "Y"

SQL_ACCESSIBLE_TABLES "Y"

SQL_ACTIVE_ENVIRONMENTS 0

SQL_AGGREGATE_FUNCTIONS All set

SQL_ALTER_DOMAIN 0

SQL_ALTER_TABLE 0

SQL_ASYNC_MODE 0

SQL_BATCH_ROW_COUNT 0

SQL_BATCH_SUPPORT 0

SQL_BOOKMARK_PERSISTENCE Multiple values

SQL_CATALOG_LOCATION SQL_QL_START

SQL_CATALOG_NAME "Y"

SQL_CATALOG_NAME_SEPARATOR "."

SQL_CATALOG_TERM "Database"

SQL_CATALOG_USAGE Multiple values

SQL_COLLATION_SEQ ""

SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE

SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL

SQL_CONVERT_BIGINT 0

SQL_CONVERT_BINARY Multiple values

SQL_CONVERT_BIT 0

SQL_CONVERT_CHAR Multiple values

SQL_CONVERT_DATE Multiple values

SQL_CONVERT_DECIMAL 0

SQL_CONVERT_DOUBLE Multiple values

SQL_CONVERT_FLOAT Multiple values

SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT

SQL_CONVERT_INTEGER Multiple values

SQL_CONVERT_LONGVARBINARY Multiple values

SQL_CONVERT_LONGVARCHAR Multiple values

SQL_CONVERT_NUMERIC Multiple values

SQL_CONVERT_REAL Multiple values

SQL_CONVERT_SMALLINT Multiple values

SQL_CONVERT_TIME Multiple values

SQL_CONVERT_TIMESTAMP Multiple values

SQL_CONVERT_TINYINT Multiple values

SQL_CONVERT_VARBINARY Multiple values

SQL_CONVERT_VARCHAR Multiple values

SQL_CORRELATION_NAME SQL_CN_ANY

SQL_CREATE_ASSERTION 0

SQL_CREATE_CHARACTER_SET 0

SQL_CREATE_COLLATION 0
INFOTYPE RETURNED VALUE

SQL_CREATE_DOMAIN 0

SQL_CREATE_SCHEMA 0

SQL_CREATE_TABLE SQL_CT_CREATE_TABLE

SQL_CREATE_TRANSLATION 0

SQL_CREATE_VIEW SQL_CV_CREATE_VIEW

SQL_CURSOR_COMMIT_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_ROLLBACK_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_SENSITIVITY SQL_UNSPECIFIED

SQL_DATA_SOURCE_NAME The DSN from Odbc.ini, or "" if DRIVER keyword is used in


Odbc.ini

SQL_DATA_SOURCE_READ_ONLY "N"

SQL_DATABASE_NAME File name

SQL_DATETIME_LITERALS 0

SQL_DBMS_NAME "ACCESS"

SQL_DBMS_VER Multiple values

SQL_DDL_INDEX Multiple values

SQL_DEFAULT_TXN_ISOLATION SQL_TXN_READ_COMMITTED

SQL_DESCRIBE_PARAMETER 0

SQL_DRIVER_HDBC Handled by the Driver Manager.

SQL_DRIVER_HENV Handled by the Driver Manager.

SQL_DRIVER_HLIB Handled by the Driver Manager.

SQL_DRIVER_HSTMT Handled by the Driver Manager.

SQL_DRIVER_NAME "OdbcJt32.dll"

SQL_DRIVER_ODBC_VER "3.51.0000"

SQL_DRIVER_VER "4.00.nnnn" (nnnn specifies the build date)

SQL_DROP_ASSERTION 0
INFOTYPE RETURNED VALUE

SQL_DROP_CHARACTER_SET 0

SQL_DROP_COLLATION 0

SQL_DROP_DOMAIN 0

SQL_DROP_SCHEMA 0

SQL_DROP_TABLE SQL_DT_DROP_TABLE

SQL_DROP_TRANSLATION 0

SQL_DROP_VIEW SQL_DV_DROP_VIEW

SQL_EXPRESSIONS_IN_ORDERBY "Y"

SQL_FILE_USAGE SQL_FILE_CATALOG

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT

SQL_GETDATA_EXTENSIONS Multiple values

SQL_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT

SQL_IDENTIFIER_CASE SQL_IC_MIXED

SQL_IDENTIFIER_QUOTE_CHAR "`" (back quote)

SQL_KEYWORDS Multiple values

SQL_LIKE_ESCAPE_CLAUSE "N"

SQL_MAX_BINARY_LITERAL_LEN 255

SQL_MAX_CATALOG_NAME_LEN 66

SQL_MAX_CHAR_LITERAL_LEN 255

SQL_MAX_COLUMN_NAME_LEN 64

SQL_MAX_COLUMNS_IN_GROUP_BY 10

SQL_MAX_COLUMNS_IN_INDEX 32

SQL_MAX_COLUMNS_IN_ORDER_BY 10

SQL_MAX_COLUMNS_IN_SELECT 255

SQL_MAX_COLUMNS_IN_TABLE 255
INFOTYPE RETURNED VALUE

SQL_MAX_CONCURRENT_ACTIVITIES 0

SQL_MAX_CURSOR_NAME_LEN 64

SQL_MAX_DRIVER_CONNECTIONS 64

SQL_MAX_INDEX_SIZE 255

SQL_MAX_PROCEDURE_NAME_LEN 64

SQL_MAX_ROW_SIZE 2096

SQL_MAX_ROW_SIZE_INCLUDES_LONG "N"

SQL_MAX_SCHEMA_NAME_LEN 0

SQL_MAX_STATEMENT_LEN 65000

SQL_MAX_TABLE_NAME_LEN 64

SQL_MAX_TABLES_IN_SELECT 16

SQL_MAX_USER_NAME_LEN 0

SQL_MULT_RESULT_SETS "N"

SQL_MULTIPLE_ACTIVE_TXN "Y"

SQL_NEED_LONG_DATA_LEN "N"

SQL_NON_NULLABLE_COLUMNS SQL_NNC_NON_NULL

SQL_NULL_COLLATION SQL_NC_LOW

SQL_NUMERIC_FUNCTIONS Multiple values

SQL_ODBC_SAG_CLI_ CONFORMANCE SQL_OSCC_COMPLIANT

SQL_ODBC_SQL_INTEGRITY "N"

SQL_ODBC_VER From Driver Manager

SQL_OJ_CAPABILITIES Multiple values

SQL_ORDER_BY_COLUMNS_IN_SELECT "N"

SQL_OUTER_JOINS "Y"

SQL_PROCEDURE_TERM "QUERY"
INFOTYPE RETURNED VALUE

SQL_PROCEDURES "Y"

SQL_QUOTED_IDENTIFIER_CASE SQL_IC_MIXED

SQL_ROW_UPDATES "N"

SQL_SCHEMA_TERM ""

SQL_SCHEMA_USAGE 0

SQL_SCROLL_OPTIONS Multiple values

SQL_SEARCH_PATTERN_ESCAPE "\"

SQL_SERVER_NAME "ACCESS"

SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"

SQL_STRING_FUNCTIONS Multiple values

SQL_SUBQUERIES Multiple values

SQL_SYSTEM_FUNCTIONS 0

SQL_TABLE_TERM "TABLE"

SQL_TIMEDATE_ADD_INTERVALS 0

SQL_TIMEDATE_DIFF_INTERVALS 0

SQL_TIMEDATE_FUNCTIONS Multiple values

SQL_TXN_CAPABLE SQL_TC_ALL

SQL_TXN_ISOLATION_OPTION SQL_TXN_READ_COMMITTED

SQL_UNION Multiple values

SQL_USER_NAME "ADMIN"
Other Access Driver Programming Details
12/20/2017 • 1 min to read • Edit Online

NOTE
This section provides Access Driver-specific information about ODBC functions and other programming details. For general
information about a function, see the appropriate topic under ODBC API Reference.

This section contains the following topics.


SQLColAttributes (Access Driver)
SQLColumns (Access Driver)
SQLConfigDataSource (Access Driver)
SQLDriverConnect (Access Driver)
SQLGetInfo (Access Driver)
SQLGetTypeInfo (Access Driver)
SQLProcedureColumns (Access Driver)
SQLSetConnectOption (Access Driver)
SQLStatistics (Access Driver)
SQLTables (Access Driver)
SQLTransact (Access Driver)
Encryption (Access Driver)
Using the ExtendedAnsiSQL Connection String Attribute (Access Driver)
SQLColAttributes (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ATTRIBUTE COMMENTS

SQL_COLUMN_DISPLAY_SIZE For LONGVARBINARY data, SQL_COLUMN_DISPLAY_SIZE is


the maximum length of the column, not the maximum length
of the column times 2.

SQL_OWNER_NAME An empty string ("") is returned in this column because owner


name is not supported.

SQL_QUALIFIER_NAME The path to a database file is returned.

SQL_COLUMN_SEARCHABLE LONGVARBINARY and LONGVARCHAR columns are reported


as SQL_UNSEARCHABLE.

Fixed-length and variable-length binary and character data


types are searchable, even though LONGVARBINARY and
LONGVARCHAR are not.

NOTE
The above is not a complete list of the attributes returned by SQLColAttributes.
SQLColumns (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a database file is returned.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

NULLABLE SQL_NO_NULLS is returned for columns that participate in a


primary key or unique index.
SQLConfigDataSource (Access Driver)
12/20/2017 • 5 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate
topic under ODBC API Reference.

The SQLConfigDataSource function that is used to add, modify, or delete a data source dynamically uses the
following keywords.

KEYWORD DESCRIPTION

COLLATINGSEQUENCE The sequence in which the fields are sorted.

This sets the same option as Collating Sequence in the


setup dialog box.

COMPACT_DB Performs data compaction on a database file. Has the


following format: COMPACT_DB=<path_name>
<optionaL_sort_order><optional ENCRYPT keyword>.

When using the COMPACT_DB keyword in the same


statement with a DSN keyword, this driver ignores the DSN
keyword. Therefore, compacting a database and specifying a
DSN is a two-step process.

CREATE_DB Creates a database file. Has the following format:


CREATE_DB=<path_name><optional_sort-order>
<optional_ENCRYPT keyword>, where the path name is the
full path to a Microsoft Access database. An error will be
returned if the path name specifies an existing database. The
sort order will be as set up in the New Database dialog box
displayed when the Create button is pressed in the Microsoft
Access Setup dialog box. If no sort order is specified, General
is used.

When using the CREATE_DB keyword in the same statement


with a DSN keyword, this driver ignores the DSN keyword.
Therefore, creating a database and specifying a DSN is a
two-step process.When using the CREATE_DB keyword, if the
pathname of the Microsoft Access database to be created
contains one or more spaces, then the entire pathname
must be enclosed by double quotation marks, as shown in
the following examples:

"C:\PROGRAM FILES\COMMON FILES\ MyAccess.mdb"

"C:\PROGRAM FILES\Access2.mdb"

CREATE_DB=C:\TEMP\test.mdb (no quotation marks needed)


KEYWORD DESCRIPTION

CREATE_SYSDB Creates a system database file. Has the following format:


CREATE_SYSDB=<path-name><optional-sort-order>, where
the path name is the full path to a Microsoft Access
database. An error will be returned if the path name specifies
an existing database. The sort order will be as set up in the
New Database dialog box displayed when the Create
button is clicked in the ODBC Microsoft Access Setup
dialog box. If no sort order is specified, General is used.

CREATE_V2DB Creates a database file that is compatible with Microsoft


Access 2.0. Has the following format: CREATE_V2DB=<path-
name><optional-sort-order>, where the path name is the
full path to a Microsoft Access database. An error will be
returned if the path name specifies an existing database. The
sort order will be as set up in the New Database dialog box
displayed when the Create button is pressed in the Microsoft
Access Setup dialog box. If no sort order is specified, General
is used.

When using the CREATE_V2DB keyword in the same


statement with a DSN keyword, this driver ignores the DSN
keyword. Therefore, creating a database and specifying a
DSN is a two-step process.

When using the CREATE_V2DB keyword, if the pathname of


the Microsoft Access database to be created contains one or
more spaces, then the entire pathname must be enclosed by
double quotation marks, as shown in the following examples:

"C:\PROGRAM FILES\COMMON FILES\ MyAccess.mdb"

"C:\PROGRAM FILES\Access2.mdb"

CREATE_V2DB=C:\TEMP\test.mdb (no quotation marks


needed)

DBQ The name of the database file.

This sets the same option as Database in the setup dialog


box.

DEFAULTDIR The path specification to the database file.

DESCRIPTION A description of the data in the data source.

This sets the same option as Description in the setup dialog


box.

DRIVER The path specification to the driver DLL.

DRIVERID An integer ID for the driver. 25 (Microsoft Access)

FIL File type MS Access for Microsoft Access


KEYWORD DESCRIPTION

IMPLICITCOMMITSYNC Determines whether the Microsoft Access driver will perform


internal or implicit commits asynchronously. This value is
initially set to "Yes", which means that the Microsoft Access
driver will wait for commits in an internal/implicit transaction
to be completed.

The value of this option should not be changed without


careful consideration of the consequences. For more
information about the option, see the Microsoft Jet
Database Engine Programmer's Guide.

This sets the same option as ImplicitCommitSync in the


setup dialog box.

MAXBUFFERSIZE The size of the internal buffer, in kilobytes, that is used by


Microsoft Access to transfer data to and from the disk. The
default buffer size is 2048 KB (displayed as 2048). Any
integer value divisible by 256 can be used. This sets the
same option as Buffer Size in the setup dialog box.

MAXSCANROWS The number of rows to be scanned when setting a column's


data type based upon existing data.

A number from 1 to 16 can be entered for the rows to scan.


The value defaults to 8; if it is set to 0, all rows are scanned.
(A number outside the limit will return an error.)

This sets the same option as Rows to Scan in the setup


dialog box.

PAGETIMEOUT Specifies the period of time, in milliseconds, that a page (if


not used) remains in the buffer before being removed. The
default is five-tenths of a second (0.5 seconds). Note that
this option applies to all data sources that use the ODBC
driver.

This sets the same option as Page Timeout in the setup


dialog box.

PWD The password.

READONLY TRUE to make file read-only; FALSE to make file not read-
only.

This sets the same option as Read Only in the setup dialog
box.

REPAIR_DB Repairs a database damaged by a failure that occurs during


the commit process.

When using the REPAIR_DB keyword in the same statement


with a DSN keyword, this driver ignores the DSN keyword.
Therefore, repairing a database and specifying a DSN is a
two-step process.
KEYWORD DESCRIPTION

SYSTEMDB For the Microsoft Access driver, the path specification to the
system database file.

This sets the same option as System Database in the setup


dialog box.

THREADS The number of background threads for the engine to use.


This value defaults to 3, but can be changed.

This sets the same option as Threads in the setup dialog


box.

UID For the Microsoft Access driver, the user ID name used for
login.

USERCOMMITSYNC Determines whether the Microsoft Access driver will perform


user-defined transactions asynchronously. This value is
initially set to "Yes", which means that the Microsoft Access
driver will wait for commits in a user-defined transaction to
be completed.

The value of this option should not be changed without


careful consideration of the consequences. For more
information about the option, see the Microsoft Jet
Database Engine Programmer's Guide.

This sets the same option as UserCommitSync in the setup


dialog box.
SQLDriverConnect (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLDriverConnect enables you to connect to a driver without creating a data source (DSN ).
The following keywords are supported in the connection string for all drivers: DSN, DBQ, and FIL.
The UID and PWD keywords are also supported.
The PWD keyword should not include any of the special characters (see SQL_SPECIAL_CHARACTERS in
SQLGetInfo Returned Values).
The following table shows the minimum keywords required to connect to each driver, and provides an example of
keyword/value pairs used with SQLDriverConnect. For a full list of DRIVERID values, see SQLConfigDataSource.

DRIVER KEYWORDS REQUIRED EXAMPLES

Microsoft Access Driver, DBQ Driver={Microsoft Access Driver


(*.mdb)}; DBQ=c:\\temp\\sample.mdb
SQLGetInfo (Access Driver)
12/20/2017 • 2 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLGetInfo supports the SQL_FILE_USAGE information type. The returned value is a 16-bit integer that
indicates how the driver directly treats files in a data source:
SQL_FILE_NOT_SUPPORTED — The driver is not a single-tier driver.
SQL_FILE_TABLE — A single-tier driver treats files in a data source as tables.
SQL_FILE_QUALIFIER — A single-tier driver treats files in a data source as a qualifier.
The ODBC driver returns SQL_FILE_QUALIFIER because each file is a complete database.

SQL_BOOKMARK_PERSISTENCE
SQL_BP_SCROLL | SQL_BP_UPDATE [1]
[1] Bookmarks persist after a commit but do not persist after a rollback.

SQL_CONVERT_BINARY
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_CHAR
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_DATE
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_DOUBLE
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_FLOAT
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_INTEGER
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_LONGVARBINARY
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_LONGVARCHAR
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_NUMERIC
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_REAL
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_SMALLINT
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_TIME
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_TIMESTAMP
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_TINYINT
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_VARBINARY
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR

SQL_CONVERT_VARCHAR
SQL_CVT_DOUBLE | SQL_CVT_FLOAT | SQL_CVT_INTEGER | SQL_CVT_NUMERIC | SQL_CVT_REAL |
SQL_CVT_SMALLINT | SQL_CVT_VARCHAR | SQL_CVT_WVARCHAR
SQL_UNION
SQL_U_UNION_ALL | SQL_U_UNION

SQL_DBMS_VER
ISAM VERSION FORMAT OF VERSION NUMBERS

Microsoft Access 2.0 02.00.0000

3.0 03.00.0000

3.5 03.50.0000

4.0 04.00.0000

NOTE
Versions 1.0 and 1.1 are not supported. Also, there is no difference in the data format in Microsoft Access versions 3.0, 7.0,
and 97.

SQL_DDL_INDEX
SQL_DL_CREATE_INDEX
SQL_DL_DROP_INDEX

SQL_GETDATA_EXTENSIONS
SQL_GD_ANY_ORDER | SQL_GD_ANY_COLUMN | SQL_GD_BLOCK | SQL_GD_BOUND

SQL_KEYWORDS
ALPHANUMERIC
AUTOINCREMENT
BINARY
BOOLEAN
BYTE
COUNTER
CURRENCY
DATABASE
DATABASENAME
DATETIME
DISALLOW
DISTINCTROW
DOUBLEFLOAT
FLOAT4
FLOAT8
GENERAL
IEEEDOUBLE
IEEESINGLE
IGNORE
IMAGE
INTEGER1
INTEGER2
INTEGER4
LOGICAL
LOGICAL1
LONG
LONGBINARY
LONGCHAR
LONGTEXT
MEMO
MONEY
NOTE
NUMBER
OLEOBJECT
OWNERACCESS
PARAMETERS
PERCENT
PIVOT
SHORT
SINGLE
SINGLEFLOAT
STDEV
STDEVP
STRING
TABLEID
TEXT
TOP
TRANSFORM
UNSIGNEDBYTE
VAR
VARBINARY
VARP
YESNO

SQL_NUMERIC_FUNCTIONS
SQL_FN_NUM_ABS | SQL_FN_NUM_ATAN | SQL_FN_NUM_CEILING | SQL_FN_NUM_COS |
SQL_FN_NUM_EXP | SQL_FN_NUM_FLOOR | SQL_FN_NUM_LOG | SQL_FN_NUM_MOD |
SQL_FN_NUM_POWER | SQL_FN_NUM_RAND | SQL_FN_NUM_SIGN | SQL_FN_NUM_SIN |
SQL_FN_NUM_SQRT | SQL_FN_NUM_TAN

SQL_OJ_CAPABILITIES
SQL_OJ_LEFT SQL_OJ_RIGHT SQL_OJ_NOT_ORDERED SQL_OJ_INNER SQL_OJ_ALL_COMPARISON_OPS

SQL_CATALOG_USAGE
SQL_QU_DML_STATEMENTS | SQL_QU_TABLE_DEFINITION | SQL_QU_INDEX_DEFINITION |
SQL_QU_PROCEDURE_INVOCATION

SQL_SCROLL_OPTIONS
SQL_SO_FORWARD_ONLY | SQL_SO_STATIC | SQL_SO_KEYSET_DRIVEN

SQL_STRING_FUNCTIONS
SQL_FN_STR_ASCII | SQL_FN_STR_CHAR | SQL_FN_STR_CONCAT | SQL_FN_STR_LCASE |
SQL_FN_STR_LEFT | SQL_FN_STR_LENGTH | SQL_FN_STR_LOCATE | SQL_FN_STR_LOCATE_2
SQL_FN_STR_LTRIM | SQL_FN_STR_RIGHT | SQL_FN_STR_RTRIM | SQL_FN_STR_SPACE |
SQL_FN_STR_SUBSTRING | SQL_FN_STR_UCASE

SQL_SUBQUERIES
SQL_SQ_COMPARISON | SQL_SQ_EXISTS | SQL_SQ_IN | SQL_SQ_QUANTIFIED |
SQL_SQ_CORREL ATED_SUBQUERIES

SQL_TIMEDATE_FUNCTIONS
SQL_FN_TD_CURDATE | SQL_FN_TD_CURTIME | SQL_FN_TD_DAYOFMONTH | SQL_FN_TD_DAYOFWEEK |
SQL_FN_TD_DAYOFYEAR | SQL_FN_TD_HOUR | SQL_FN_TD_MINUTE | SQL_FN_TD_MONTH |
SQL_FN_TD_NOW | SQL_FN_TD_SECOND | SQL_FN_TD_WEEK | SQL_FN_TD_YEAR
SQLGetTypeInfo (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

The name of the type (TYPE_NAME ) returned in the table produced by SQLGetTypeInfo will be the name most
commonly used by the data source.
SQL_ALL_EXCEPT_LIKE will be returned in the SEARCHABLE column for the Byte, Counter, Double, Single, Long,
and Short data types. (The LIKE capability can be achieved by converting the value to a character using the ODBC
canonical conversion functions, then performing the comparison.)
SQLProcedureColumns (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

Application developers should look for driver-defined columns starting at the end of the result set and proceeding
backward.

COLUMN COMMENTS

COLUMN_TYPE SQL_PARAM_INPUT or SQL_RESULT_COL

ORDINAL This is a driver-specific column that is returned at the end of


the result set. The SQL type of the column is an integer.
SQLSetConnectOption (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

FOPTION COMMENT

SQL_ACCESS_MODE The SQL_ACCESS_MODE fOption can be set to either


SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE.
However, the driver does not prevent updates if
SQL_ACCESS_MODE is set to SQL_MODE_READ_ONLY.

SQL_AUTOCOMMIT When the Microsoft Access driver is used, the


SQL_AUTOCOMMIT option may be set to either
SQL_AUTOCOMMIT_ON or SQL_AUTOCOMMIT_OFF, because
the Microsoft Access driver supports transactions[1].

SQL_CURRENT_QUALIFIER Supported.

SQL_LOGIN_TIMEOUT Not supported.

SQL_OPT_TRACE Supported.

SQL_OPT_TRACEFILE Supported.

SQL_PACKET_SIZE Not supported.

SQL_QUIET_MODE Not supported.

SQL_TRANSLATE_DLL Not supported.

SQL_TRANSLATION_OPTION Not supported.

SQL_TXN_ISOLATION SQL_TXN_ISOLATION is always SQL_TXN_READ_COMMITTED.

[1] Atomic transactions are not supported by the Microsoft Access driver. When committing a transaction using the
Microsoft Access driver, a finite delay exists between the time the transaction is committed and the time the values
are written to disk. This delay is determined by a delay inherent in the Microsoft Jet engine. The page timeout will
not be less than a minimum value, even if the PageTimeout option is set below that value. As a result, there is no
guarantee that committed data is stable, since changes may be made during the delay.
SQLStatistics (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a database file is returned for Microsoft Access.

Pattern matching is not supported in the szTableQualifier


argument.

TABLE_OWNER NULL is returned in this column, because owner name is not


supported.

TABLE_NAME Undelimited table name.

Pattern matching is not supported in the szTableName


argument.

INDEX_QUALIFIER NULL is always returned.

INDEX_NAME Index-dependent.

TYPE Only SQL_TABLE_STAT or SQL_INDEX_OTHER will be returned


for TYPE.

SEQ_IN_INDEX Index-dependent.

COLUMN_NAME Index-dependent.

COLLATION Index-dependent.

CARDINALITY Returned for Microsoft Access only.

PAGES NULL is always returned.

Filtering is based on uniqueness (the fUnique argument). The fAccuracy parameter is ignored.
SQLTables (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ARGUMENT COMMENTS

szTableOwner The only valid argument for szTableOwner is NULL because


none of the drivers support owner names. With szTableOwner
set to NULL, all tables are returned. NULL is returned in the
TABLE_OWNER column.

szTableQualifier In the TABLE_QUALIFIER column, SQLTables will return the


path to a database file.

SzTableType When the Microsoft Access driver is used, "SYSTEM TABLE" is


supported for szTableType for system tables, "SYNONYM" is
supported for attached tables, and "VIEW" is supported for
row-returning queries.

See Also
SQLTables Function
SQLTransact (Access Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

When the Microsoft Access driver is used, SQL_COMMIT and SQL_ROLLBACK are supported for the fType
argument in a call to SQLTransact.
If a failure occurs during the commit process, the affected database can be repaired using the Repair Database
option in the Microsoft Access driver setup, or through the use of the REPAIR_DB keyword in the
SQLConfigDataSource function.
Encryption (Access Driver)
12/20/2017 • 1 min to read • Edit Online

(This control is available only when Version 4.x format is selected.)


With the release of the 4.0 version of the Microsoft Jet Database Engine, database encryption is allowed when
creating Access databases. See the Jet Database Engine Programmer's Reference for additional information.
Using the ExtendedAnsiSQL Connection String
Attribute (Access Driver)
12/20/2017 • 1 min to read • Edit Online

Jet 4.0 has several new features that are not enabled by default in the ODBC Desktop Database Drivers version 4.0.
To take advantage of these new features, an application will have to set a new connection attribute, add a new
attribute to the connection string, or set the attribute in a DSN. The attribute is called ExtendedAnsiSQL and
pertains only to the Microsoft ODBC Desktop Database Drivers 4.0 and later.
This section contains the following topics.
Setting ExtendedAnsiSQL
Enabling New Data Types by Setting ExtendedAnsiSQL
Creating and Dropping Views and Procedures Using ExtendedAnsiSQL
Data Trunctation Detection Enabled Using ExtendedAnsiSQL
Jet 4.0 Uses SQL -92 Reserved Words List when ExtendedAnsiSQL Set
Setting ExtendedAnsiSQL
12/20/2017 • 1 min to read • Edit Online

The attribute can be controlled in the connection string by adding the ExtendedAnsiSQL attribute:

VALUE DESCRIPTION

ExtendedAnsiSQL=0 (default) This setting does not enable the new features.

ExtendedAnsiSQL=1 This setting enables the new features.

The attribute can also be set in a DSN through the Advanced Options dialog box when configuring a DSN
through Control Panel.
Setting the attribute to 0 disables the new features; setting it to 1 enables the new features.
The attribute can also be set using SQLSetConnectAttr(). The attribute value is 65501 and is set to a SQLINTEGER
value of 1 or 0, as documented in the preceding table. It can be called before or after connecting, but it is better to
call it after connecting because of the order in which the driver processes cached connection attributes and
connection strings.
Enabling New Data Types by Setting
ExtendedAnsiSQL
12/20/2017 • 1 min to read • Edit Online

Two new data types are available in Jet 4.0 databases when the ExtendedAnsiSQL flag is turned on:
SQL_DECIMAL and SQL_NUMERIC. The default precision and scale are 18 and 0, respectively. Data accessed via
ODBC that is typed as SQL_DECIMAL or SQL_NUMERIC will be mapped to Microsoft Jet Decimal instead of
Currency.
When the ExtendedAnsiSQL flag is turned off, you cannot create tables with decimal or numeric types, and these
types will not appear in SQLGetTypeInfo(). However, if the table contains the new data types, they can be used with
the correct data types.
Creating and Dropping Views and Procedures Using
ExtendedAnsiSQL
12/20/2017 • 1 min to read • Edit Online

When the ExtendedAnsiSQL flag is turned on, Jet 4.0 supports the ability to create and drop views and procedures
through SQL. These views and procedures will not be visible through Access.
Data Truncation Detection Enabled Using
ExtendedAnsiSQL
12/20/2017 • 1 min to read • Edit Online

When the ExtendedAnsiSQL flag is turned on and the application is inserting data into a char or binary column
and data is truncated, the truncation will be detected. When the ExtendedAnsiSQL flag is turned off, the data is
truncated without warning, as it was in previous versions of the ODBC Desktop Database Drivers.
Jet 4.0 Uses SQL-92 Reserved Words List when
ExtendedAnsiSQL_Set
12/20/2017 • 1 min to read • Edit Online

When the ExtendedAnsiSQL flag is turned on, Jet 4.0 uses the SQL -92 reserved words list. Trying to use a SQL -92
reserved word as an unquoted object name will result in a syntax error. When the ExtendedAnsiSQL flag is turned
off, the new reserved words can be used as object names as before.
Microsoft Excel Driver Programming Considerations
12/20/2017 • 1 min to read • Edit Online

This section contains the following topics.


Setting Options Programmatically for the Excel Driver
Microsoft Excel Data Types
SQLGetInfo Returned Values for Excel
Other Excel Driver Programming Details
Setting Options Programmatically for the Excel Driver
12/20/2017 • 2 min to read • Edit Online

OPTION DESCRIPTION METHOD

Data Source Name A name that identifies the data source, To set this option dynamically, use the
such as Payroll or Personnel. DSN keyword in a call to
SQLConfigDataSource.

Database A Microsoft Access data source can be To set this option dynamically, use the
set up without selecting or creating a DBQ keyword in a call to
database. If no database is provided SQLConfigDataSource.
upon setup, the user will be prompted
to choose a database file when
connecting to the data source.

Description An optional description of the data in To set this option dynamically, use the
the data source; for example, "Hire date, DESCRIPTION keyword in a call to
salary history, and current review of all SQLConfigDataSource.
employees."

Directory Displays the currently selected To set this option dynamically, use the
directory. DEFAULTDIR keyword in a call to
SQLConfigDataSource.
For Microsoft Excel 3.0/4.0 files, the
path display is labeled "Directory", while
for Microsoft Excel 5.0, 7.0, or 97 files,
the path display is labeled "Workbook".

Read Only Designates the database as read-only. To set this option dynamically, use the
READONLY keyword in a call to
SQLConfigDataSource.

Rows to Scan The number of rows to scan to To set this option dynamically, use the
determine the data type of each MAXSCANROWS keyword in a call to
column. The data type is determined SQLConfigDataSource.
given the maximum number of kinds of
data found. If data is encountered that
does not match the data type guessed
for the column, the data type will be
returned as a NULL value.

For the Microsoft Excel driver, you can


enter a number from 1 to 16 for the
rows to scan. The value defaults to 8; if
it is set to 0, all rows are scanned. (A
number outside the limit will return an
error.)
OPTION DESCRIPTION METHOD

Select Directory Displays a dialog box where you can To set this option dynamically, use the
select a directory containing the files DEFAULTDIR keyword in a call to
you want to access. SQLConfigDataSource.

When defining a data source directory


(for all drivers except Microsoft Access),
specify the directory where your most
commonly used files are located. The
ODBC driver uses this directory as the
default directory. Copy other files into
this directory if they are used
frequently. Alternatively, you can qualify
file names in a SELECT statement with
the directory name:

SELECT * FROM C:\MYDIR\EMP

Or, you can specify a new default


directory by using the
SQLSetConnectOption function with
the SQL_CURRENT_QUALIFIER option.

For Microsoft Excel 3.0 or 4.0 files, the


path display is labeled "Directory", and
the path selection button is labeled
"Select Directory". For Microsoft Excel
5.0, 7.0, or 97 files, the path display is
labeled "Workbook", and the path
selection button is labeled "Select
Workbook". When defining a data
source directory, specify the directory
where your most commonly used
Microsoft Excel files are located for
Microsoft Excel 3.0/4.0, or the directory
where the workbook file is located for
Microsoft Excel 5.0, 7.0, or 97. Use
Current Directory is disabled for
Microsoft Excel 5.0, 7.0, and 97.
Microsoft Excel Data Types
12/20/2017 • 1 min to read • Edit Online

The following table shows how Microsoft Excel driver data types are mapped to ODBC SQL data types. The
Microsoft Excel driver assigns these data types to columns in Microsoft Excel tables based on the data in the
column.

MICROSOFT EXCEL DATA TYPE ODBC DATA TYPE

CURRENCY SQL_NUMERIC

DATETIME SQL_TIMESTAMP

LOGICAL SQL_BIT

NUMBER SQL_DOUBLE

TEXT SQL_VARCHAR

NOTE
SQLGetTypeInfo returns ODBC SQL data types. All conversions in Appendix D of the ODBC Programmer's Reference are
supported for the ODBC SQL data types listed earlier in this topic.

The following table shows limitations on Microsoft Excel data types.

DATA TYPE DESCRIPTION

Encrypted data The Microsoft Excel driver cannot read encrypted data.

Error Strings The Microsoft Excel driver cannot return a character string for
the Microsoft Excel error values (#N/A!, #VALUE!, #REF!,
#DIV/0!, #NUM!, #NAME?, and #NULL!), but returns a NULL
instead.

LOGICAL The value in a LOGICAL column is returned in a SQL_C_CHAR


buffer as either 0 or 1.

NUMBER If an integer column is created, numbers that are too big for
the integer data type can be entered, and data containing
non-integer values can be inserted, with the result that the
column may be converted to SQL_DOUBLE.
DATA TYPE DESCRIPTION

TEXT When the rows of a column contain more than one Microsoft
Excel data type, the ODBC Microsoft Excel driver assigns the
SQL_VARCHAR data type to the column. There is one
exception to this: if the column contains only two or three of
the datetime data types (DATE, TIME, and DATETIME), the
ODBC Microsoft Excel driver assigns the SQL_TIMESTAMP
data type to the column.

Creating a TEXT column of zero or unspecified length actually


returns a 255-byte column.

A character string literal can contain any ANSI character (1-


255 decimal). Use two consecutive single quotation marks (")
to represent one single quotation mark (').

Inserting a NULL into a column with a data type other than


SQL_VARCHAR will cause the data type of the column to
change to SQL_VARCHAR.

More limitations on data types can be found in Data Type Limitations.


SQLGetInfo Returned Values for Excel
12/20/2017 • 2 min to read • Edit Online

The following table lists the C -language #defines for the fInfoType argument and the corresponding values
returned by SQLGetInfo. This information can be retrieved by passing the listed C -language #defines to
SQLGetInfo in the fInfoType argument. For more information about the values returned by SQLGetInfo, see the
ODBC Programmer's Reference.

NOTE
Where SQLGetInfo returns a 32-bit bitmask, a vertical bar (|) represents a bitwise OR.

INFOTYPE RETURNED VALUE

SQL_ACCESSIBLE_PROCEDURES "N"

SQL_ACCESSIBLE_TABLES "Y"

SQL_ACTIVE_ENVIRONMENTS 0

SQL_AGGREGATE_FUNCTIONS All set

SQL_ALTER_DOMAIN 0

SQL_ALTER_TABLE 0

SQL_ASYNC_MODE 0

SQL_BATCH_ROW_COUNT 0

SQL_BATCH_SUPPORT 0

SQL_BOOKMARK_PERSISTENCE Multiple values

SQL_CATALOG_LOCATION SQL_QL_START

SQL_CATALOG_NAME "Y"

SQL_CATALOG_NAME_SEPARATOR Multiple values

SQL_CATALOG_TERM Multiple values

SQL_CATALOG_USAGE Multiple values

SQL_COLLATION_SEQ ""

SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE

SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL

SQL_CONVERT_BIGINT 0

SQL_CONVERT_BINARY Multiple values

SQL_CONVERT_BIT 0

SQL_CONVERT_CHAR Multiple values

SQL_CONVERT_DATE Multiple values

SQL_CONVERT_DECIMAL 0

SQL_CONVERT_DOUBLE Multiple values

SQL_CONVERT_FLOAT Multiple values

SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT

SQL_CONVERT_INTEGER Multiple values

SQL_CONVERT_LONGVARBINARY Multiple values

SQL_CONVERT_LONGVARCHAR Multiple values

SQL_CONVERT_NUMERIC Multiple values

SQL_CONVERT_REAL Multiple values

SQL_CONVERT_SMALLINT Multiple values

SQL_CONVERT_TIME Multiple values

SQL_CONVERT_TIMESTAMP Multiple values

SQL_CONVERT_TINYINT Multiple values

SQL_CONVERT_VARBINARY Multiple values

SQL_CONVERT_VARCHAR Multiple values

SQL_CORRELATION_NAME SQL_CN_ANY

SQL_CREATE_ASSERTION 0

SQL_CREATE_CHARACTER_SET 0

SQL_CREATE_COLLATION 0
INFOTYPE RETURNED VALUE

SQL_CREATE_DOMAIN 0

SQL_CREATE_SCHEMA 0

SQL_CREATE_TABLE SQL_CT_CREATE_TABLE

SQL_CREATE_TRANSLATION 0

SQL_CREATE_VIEW 0

SQL_CURSOR_COMMIT_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_ROLLBACK_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_SENSITIVITY SQL_UNSPECIFIED

SQL_DATA_SOURCE_NAME The DSN from Odbc.ini, or "" if DRIVER keyword is used in


Odbc.ini

SQL_DATA_SOURCE_READ_ONLY "Y"

SQL_DATABASE_NAME Current database directory

SQL_DATETIME_LITERALS 0

SQL_DBMS_NAME "EXCEL"

SQL_DBMS_VER Multiple values

SQL_DDL_INDEX 0

SQL_DEFAULT_TXN_ISOLATION 0

SQL_DESCRIBE_PARAMETER 0

SQL_DRIVER_HDBC Handled by the Driver Manager.

SQL_DRIVER_HENV Handled by the Driver Manager.

SQL_DRIVER_HLIB Handled by the Driver Manager.

SQL_DRIVER_HSTMT Handled by the Driver Manager.

SQL_DRIVER_NAME "OdbcJt32.dll"

SQL_DRIVER_ODBC_VER "3.51.0000"

SQL_DRIVER_VER "4.00.nnnn" (nnnn specifies the build date)

SQL_DROP_ASSERTION 0
INFOTYPE RETURNED VALUE

SQL_DROP_CHARACTER_SET 0

SQL_DROP_COLLATION 0

SQL_DROP_DOMAIN 0

SQL_DROP_SCHEMA 0

SQL_DROP_TABLE SQL_DT_DROP_TABLE

SQL_DROP_TRANSLATION 0

SQL_DROP_VIEW SQL_DV_DROP_VIEW

SQL_EXPRESSIONS_IN_ORDERBY "Y"

SQL_FILE_USAGE Multiple values

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT

SQL_GETDATA_EXTENSIONS Multiple values

SQL_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT

SQL_IDENTIFIER_CASE SQL_IC_MIXED

SQL_IDENTIFIER_QUOTE_CHAR "`" (back quote)

SQL_KEYWORDS Multiple values

SQL_LIKE_ESCAPE_CLAUSE "N"

SQL_MAX_BINARY_LITERAL_LEN 255

SQL_MAX_CATALOG_NAME_LEN 66

SQL_MAX_CHAR_LITERAL_LEN Multiple values

SQL_MAX_COLUMN_NAME_LEN Multiple values

SQL_MAX_COLUMNS_IN_GROUP_BY 10

SQL_MAX_COLUMNS_IN_INDEX 0

SQL_MAX_COLUMNS_IN_ORDER_BY 10

SQL_MAX_COLUMNS_IN_SELECT 255
INFOTYPE RETURNED VALUE

SQL_MAX_COLUMNS_IN_TABLE 255

When using the Microsoft Excel Driver, a CREATE TABLE


statement might allow 256 columns, but the 255-column limit
is still valid and an insert into column 256 will fail.

SQL_MAX_CONCURRENT_ACTIVITIES 0

SQL_MAX_CURSOR_NAME_LEN 64

SQL_MAX_DRIVER_CONNECTIONS 64

SQL_MAX_INDEX_SIZE 0

SQL_MAX_PROCEDURE_NAME_LEN 0

SQL_MAX_ROW_SIZE 65535

SQL_MAX_ROW_SIZE_INCLUDES_LONG "Y"

SQL_MAX_SCHEMA_NAME_LEN 0

SQL_MAX_STATEMENT_LEN 65000

SQL_MAX_TABLE_NAME_LEN Multiple values

SQL_MAX_TABLES_IN_SELECT 16

SQL_MAX_USER_NAME_LEN 0

SQL_MULT_RESULT_SETS "N"

SQL_MULTIPLE_ACTIVE_TXN "Y"

SQL_NEED_LONG_DATA_LEN "N"

SQL_NON_NULLABLE_COLUMNS SQL_NNC_NON_NULL

SQL_NULL_COLLATION SQL_NC_LOW

SQL_NUMERIC_FUNCTIONS Multiple values

SQL_ODBC_SAG_CLI_ CONFORMANCE SQL_OSCC_COMPLIANT

SQL_ODBC_SQL_INTEGRITY "N"

SQL_ODBC_VER From Driver Manager

SQL_OJ_CAPABILITIES Multiple values

SQL_ORDER_BY_COLUMNS_IN_SELECT "N"
INFOTYPE RETURNED VALUE

SQL_OUTER_JOINS "Y"

SQL_PROCEDURE_TERM ""

SQL_PROCEDURES "N"

SQL_QUOTED_IDENTIFIER_CASE SQL_IC_MIXED

SQL_ROW_UPDATES "N"

SQL_SCHEMA_TERM ""

SQL_SCHEMA_USAGE 0

SQL_SCROLL_OPTIONS Multiple values

SQL_SEARCH_PATTERN_ESCAPE "\"

SQL_SERVER_NAME "EXCEL"

SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"

SQL_STRING_FUNCTIONS Multiple values

SQL_SUBQUERIES Multiple values

SQL_SYSTEM_FUNCTIONS 0

SQL_TABLE_TERM "TABLE"

SQL_TIMEDATE_ADD_INTERVALS 0

SQL_TIMEDATE_DIFF_INTERVALS 0

SQL_TIMEDATE_FUNCTIONS Multiple values

SQL_TXN_CAPABLE SQL_TC_NONE

SQL_TXN_ISOLATION_OPTION 0

SQL_UNION Multiple values

SQL_USER_NAME ""
Other Excel Driver Programming Details
12/20/2017 • 1 min to read • Edit Online

NOTE
This section provides Excel Driver-specific information about ODBC functions and other programming details. For general
information about a function, see the appropriate topic under ODBC API Reference.

This section contains the following topics.


SQLBindParameter (Excel Driver)
SQLColAttributes (Excel Driver)
SQLColumns (Excel Driver)
SQLConfigDataSource (Excel Driver)
SQLDriverConnect (Excel Driver)
SQLGetInfo (Excel Driver)
SQLGetTypeInfo (Excel Driver)
SQLSetConnectOption (Excel Driver)
SQLStatistics (Excel Driver)
SQLTables (Excel Driver)
SQLTransact (Excel Driver)
Read-Only Status (Excel Driver)
SQLBindParameter (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

When the Microsoft Excel driver is used, executing an INSERT statement that uses a parameter to insert a NULL
into a SQL_CHAR column will return SQL_SUCCESS_WITH_INFO with SQLSTATE 01004, "Data Truncated."
SQLColAttributes (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ATTRIBUTE COMMENTS

SQL_COLUMN_DISPLAY_SIZE For LONGVARBINARY data, SQL_COLUMN_DISPLAY_SIZE is


the maximum length of the column, not the maximum length
of the column times 2.

SQL_OWNER_NAME An empty string ("") is returned in this column because owner


name is not supported.

SQL_QUALIFIER_NAME The path to a directory is returned.

SQL_COLUMN_SEARCHABLE LONGVARBINARY and LONGVARCHAR columns are reported


as SQL_UNSEARCHABLE.

Fixed-length and variable-length binary and character data


types are searchable, even though LONGVARBINARY and
LONGVARCHAR are not.

NOTE
The above is not a complete list of the attributes returned by SQLColAttributes.
SQLColumns (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory is returned.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

NULLABLE SQL_NO_NULLS is returned for columns that participate in a


primary key or unique index.
ODBC Jet SQLConfigDataSource (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

The SQLConfigDataSource function that is used to add, modify, or delete a data source dynamically uses the
following keywords.

KEYWORD DESCRIPTION

DBQ For the Microsoft Excel driver when accessing Microsoft Excel
5.0 or later files, the name of the workbook file.

This sets the same option as Database in the setup dialog


box.

DEFAULTDIR The path specification to the directory.

This sets the same option as Select Directory or Select


Workbook in the setup dialog box.

DESCRIPTION A description of the data in the data source.

This sets the same option as Description in the setup dialog


box.

DRIVER The path specification to the driver DLL.

DRIVERID An integer ID for the driver.

534 (Microsoft Excel 3.0)

278 (Microsoft Excel 4.0)

22 (Microsoft Excel 5.0/7.0)

790 (Microsoft Excel 97-2003)

FIL File type, for example, Excel 3.0, Excel 4.0, Excel 5.0, Excel 7.0,
Excel 97, Excel 2000, or Excel 2003.

FIRSTROWHASNAMES Indicates whether the cells of the first row of the range
contain the column names for the table (1) or not (0).
KEYWORD DESCRIPTION

MAXSCANROWS The number of rows to be scanned when setting a column's


data type based upon existing data.

A number from 1 to 16 can be entered for the rows to scan.


The value defaults to 8; if it is set to 0, all rows are scanned.
(A number outside the limit will return an error.)

This sets the same option as Rows to Scan in the setup


dialog box.

READONLY TRUE to make file read-only; FALSE to make file not read-
only.

This sets the same option as Read Only in the setup dialog
box.

THREADS The number of background threads for the engine to use. For
the Microsoft Access driver, this value defaults to 3, but can
be changed. For the dBASE, MicrosoftExceldriver this value is
3, and cannot be changed.

This sets the same option as Threads in the setup dialog


box.
SQLDriverConnect (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLDriverConnect enables you to connect to a driver without creating a data source (DSN ).
The following keywords are supported in the connection string for all drivers: DSN, DBQ, and FIL.
The following table shows the minimum keywords required to connect to each driver, and provides an example of
keyword/value pairs used with SQLDriverConnect. For a full list of DRIVERID values, see SQLConfigDataSource.

NOTE
If DBQ or DefaultDir is not specified for the Microsoft Excel 3.0 or 4.0 driver, the driver will connect to the current directory.

DRIVER KEYWORDS REQUIRED EXAMPLES

Microsoft Excel 3.0 or 4.0 Driver, DriverID Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\temp; DriverID=278

Microsoft Excel 5.0/7.0 Driver, DriverID, DBQ Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\temp\sample.xls; DriverID=22

Microsoft Excel 97 and later Driver, DriverID, DBQ Driver={Microsoft Excel Driver (*.xls)};
DBQ=c:\temp\sample.xls; DriverID=790
SQLGetInfo (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLGetInfo supports the SQL_FILE_USAGE information type. The returned value is a 16-bit integer that
indicates how the driver directly treats files in a data source:
SQL_FILE_NOT_SUPPORTED — The driver is not a single-tier driver.
SQL_FILE_TABLE — A single-tier driver treats files in a data source as tables.
SQL_FILE_QUALIFIER — A single-tier driver treats files in a data source as a qualifier.
The ODBC driver returns SQL_FILE_TABLE for theMicrosoft Exceldriver because each file is a table.

SQL_DBMS_VER
ISAM VERSION FORMAT OF VERSION NUMBERS

Microsoft Excel 3.0 03.00.0000

4.0 04.00.0000

5.0/7.0 05.00.0000

97/2000 08.00.0000

SQL_FILE_USAGE
SQL_FILE_TABLE (Excel 3.0/4.0)
SQL_FILE_CATALOG (Excel 5.0/7.0)

SQL_MAX_CHAR_LITERAL_LEN
255 (Excel 3.0/4.0/5.0/7.0)
65535 (Excel 97)

SQL_MAX_COLUMN_NAME_LEN
30 (Excel 3.0/4.0)
64 (Excel 5.0/7.0/97)

SQL_MAX_TABLE_NAME_LEN
12 (Excel 3.0/4.0)
31 (Excel 5.0/7.0/97)

SQL_CATALOG_NAME_SEPARATOR
"\" (Excel 3.0/4.0)
"." (Excel 5.0/7.0/97)

SQL_CATALOG_TERM
"Directory" (Excel 3.0/4.0)
"Workbook" (Excel 5.0/7.0/97)

SQL_CATALOG_USAGE
SQL_QU_DML_STATEMENTS | SQL_QU_TABLE_DEFINITION

SQL_TIMEDATE_FUNCTIONS
SQL_FN_TD_CURDATE | SQL_FN_TD_CURTIME | SQL_FN_TD_DAYOFMONTH | SQL_FN_TD_DAYOFWEEK |
SQL_FN_TD_DAYOFYEAR | SQL_FN_TD_HOUR | SQL_FN_TD_MINUTE | SQL_FN_TD_MONTH |
SQL_FN_TD_NOW | SQL_FN_TD_SECOND | SQL_FN_TD_WEEK | SQL_FN_TD_YEAR
SQLGetTypeInfo (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

The name of the type (TYPE_NAME ) returned in the table produced by SQLGetTypeInfo will be the name most
commonly used by the data source.
SQL_ALL_EXCEPT_LIKE will be returned in the SEARCHABLE column for the Byte, Counter, Double, Single, Long,
and Short data types. (The LIKE capability can be achieved by converting the value to a character using the ODBC
canonical conversion functions, then performing the comparison.)
When the Microsoft Excel driver is used, the ODBC type names are returned in the TYPE_NAME column that is
returned by SQLGetTypeInfo.
SQLSetConnectOption (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

FOPTION COMMENT

SQL_ACCESS_MODE The SQL_ACCESS_MODE fOption can be set to either


SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE.
However, the driver does not prevent updates if
SQL_ACCESS_MODE is set to SQL_MODE_READ_ONLY.

SQL_AUTOCOMMIT The Microsoft Excel driver only supports SQL_AUTOCOMMIT


being set to ON (the default state), because they do not
support transactions.

SQL_CURRENT_QUALIFIER Supported.

SQL_LOGIN_TIMEOUT Not supported.

SQL_OPT_TRACE Supported.

SQL_OPT_TRACEFILE Supported.

SQL_PACKET_SIZE Not supported.

SQL_QUIET_MODE Not supported.

SQL_TRANSLATE_DLL Not supported.

SQL_TRANSLATION_OPTION Not supported.

SQL_TXN_ISOLATION Not supported.


SQLStatistics (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory.

Pattern matching is not supported in the szTableQualifier


argument.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

TABLE_NAME Undelimited table name.

Pattern matching is not supported in the szTableName


argument.

INDEX_QUALIFIER NULL is always returned.

INDEX_NAME Index-dependent.

TYPE Only SQL_TABLE_STAT or SQL_INDEX_OTHER will be returned


for TYPE.

SEQ_IN_INDEX Index-dependent.

COLUMN_NAME Index-dependent.

COLLATION Index-dependent.

PAGES NULL is always returned.

Filtering is based on uniqueness (the fUnique argument). The fAccuracy parameter is ignored.
SQLTables (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ARGUMENT COMMENTS

szTableOwner The only valid argument for szTableOwner is NULL because


none of the drivers support owner names. With szTableOwner
set to NULL, all tables are returned. NULL is returned in the
TABLE_OWNER column.

szTableQualifier When the Microsoft Excel 3.0 or 4.0 driver is used, if you call
SQLTables with a value for szTableQualifier that is not the
name of an existing table, the driver will create a table with
that name.

In the TABLE_QUALIFIER column, SQLTables will return the


path to a directory.

SzTableType For Microsoft Excel 3.0 or 4.0, "TABLE" is the only table type
supported.

For later versions of Microsoft Excel files, "SYSTEM TABLE" is


returned for sheet names (tables with a "$" on the end), and
"TABLE" is returned for tables within worksheets.
SQLTransact (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

This function supports SQL_COMMIT, but not SQL_ROLLBACK.


Read-Only Status (Excel Driver)
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Excel driver is used, data source tables are opened as read-only by default, and can be opened
by only one user at a time. Even though tables have read-only status, however, applications can perform insertions
and updates for Microsoft Excel tables.
When an application performs a Save As command on Microsoft Excel data through the Microsoft Excel driver, the
application should create a new table and insert the data to be saved into the new table. Inserts result in an append
to the table. No other operations can be performed on the table until it is closed and reopened. Once the table is
closed, no subsequent insert can be performed because the table is then a read-only table.
It is possible to update values when using the Microsoft Excel driver, but a row cannot be deleted from a table
based on a Microsoft Excel spreadsheet, so updates are not considered officially supported by the Microsoft Excel
driver.
Paradox Driver Programming Considerations
12/20/2017 • 1 min to read • Edit Online

This section contains the following topics:


Setting Options Programmatically for the Paradox Driver
Paradox Data Types
SQLGetInfo Returned Values for Paradox
Other Paradox Driver Programming Details

NOTE
Accessing Paradox ISAM files through the ODBC Desktop Database Drivers requires installation of the Borland database
engine.
Setting Options Programmatically for the Paradox
Driver
12/20/2017 • 2 min to read • Edit Online

OPTION DESCRIPTION METHOD

Directory Sets the targeted directory. To set this option dynamically, use the
DEFAULTDIR keyword in a call to
SQLConfigDataSource.

Collating Sequence The sequence in which the fields are To set this option dynamically, use the
sorted. COLLATINGSEQUENCE keyword in a
call to SQLConfigDataSource.
The sequence can be ASCII (the default),
International, Swedish-Finnish, or
Norwegian-Danish.

Description An optional description of the data in To set this option dynamically, use the
the data source; for example, "Hire date, DESCRIPTION keyword in a call to
salary history, and current review of all SQLConfigDataSource.
employees."

Exclusive If the Exclusive box is selected, the To set this option dynamically, use the
database will be opened in Exclusive EXCLUSIVE keyword in a call to
mode and can be accessed by only one SQLConfigDataSource.
user at a time. Performance is enhanced
when running in Exclusive mode.

Net Style The network access style to use when To set this option dynamically, use the
accessing Paradox data: either "3.x" for PARADOXNETSTYLE keyword in a call
Paradox 3.x or "4.x" for Paradox 4.x or to SQLConfigDataSource.
5.x. Can be set to "3.x" or "4.x" if the
version is Paradox 4.x or 5.x; if the
version is Paradox 3.x, the style must be
"3.x".

Page Timeout Specifies the period of time, in tenths of To set this option dynamically, use the
a second, that a page (if not used) PAGETIMEOUT keyword in a call to
remains in the buffer before being SQLConfigDataSource.
removed. The default is 600 tenths of a
second (60 seconds). This option applies
to all data sources that use the ODBC
driver.

The page timeout cannot be 0 because


of an inherent delay. The page timeout
cannot be less than the inherent delay,
even if the page timeout option is set
below that value.

Read Only Designates the database as read-only. To set this option dynamically, use the
READONLY keyword in a call to
SQLConfigDataSource.
OPTION DESCRIPTION METHOD

Select Directory Displays a dialog box where you can To set this option dynamically, use the
select a directory containing the files DEFAULTDIR keyword in a call to
you want to access. SQLConfigDataSource.

When defining a data source directory


specify the directory where your most
commonly used files are located. The
ODBC driver uses this directory as the
default directory. Copy other files into
this directory if they are used
frequently. Alternatively, you can qualify
file names in a SELECT statement with
the directory name:

SELECT * FROM C:\MYDIR\EMP

Or, you can specify a new default


directory by using the
SQLSetConnectOption function with
the SQL_CURRENT_QUALIFIER option.

Select Network Directory The full path of the directory containing To set this option dynamically, use the
a Paradox lock database, because it PARADOXNETPATH keyword in a call
contains either the Pdoxusrs.net file (in to SQLConfigDataSource.
Paradox 4.x) or the Paradox.net file (in
Paradox 5.x). If the directory does not
contain one of these files, the Paradox
driver creates one. For information
about these files, see the Paradox
documentation.

Before you can select a network


directory, you must enter your Paradox
user name in the User Name text box.
Click Select Network Directory to
select a network directory.

User Name The Paradox user name. This is the To set this option dynamically, use the
name displayed to other users of PARADOXUSERNAME keyword in a
Paradox files when a lock is call to SQLConfigDataSource.
encountered.
Paradox Data Types
12/20/2017 • 1 min to read • Edit Online

The ODBC Paradox driver maps Paradox data types to ODBC SQL data types. The following table lists all Paradox
data types and shows the ODBC SQL data types they are mapped to.

PARADOX DATA TYPE ODBC DATA TYPE

ALPHANUMERIC SQL_VARCHAR

AUTOINCREMENT[1] SQL_INTEGER

BCD[1] SQL_DOUBLE

BYTES[1] SQL_BINARY

DATE SQL_DATE

IMAGE[2] SQL_LONGVARBINARY

LOGICAL[1] SQL_BIT

LONG[1] SQL_INTEGER

MEMO[2] SQL_LONGVARCHAR

MONEY[1] SQL_DOUBLE

NUMBER SQL_DOUBLE

SHORT SQL_SMALLINT

TIME[1] SQL_TIMESTAMP

TIMESTAMP[1] SQL_TIMESTAMP

[1] Valid only for Paradox versions 5.x.


[2] Valid only for Paradox versions 4.x and 5.x.

NOTE
SQLGetTypeInfo returns ODBC SQL data types. All conversions in Appendix D of the ODBC Programmer's Reference are
supported for the ODBC SQL data types listed earlier in this topic.

The following table shows limitations on Paradox data types.


DATA TYPE DESCRIPTION

ALPHANUMERIC Creating an ALPHANUMERIC column of zero or unspecified


length actually returns a 255-byte column.

BYTES If you insert NULL into a binary column with the Paradox5
driver, it is changed to 0.

LONG The maximum negative value supported by the Paradox driver


for the Long data type in Paradox 5.x is not -2^31 (-
2147483648), as it should be since Long maps to the ODBC
data type SQL_INTEGER. The maximum negative value
supported for Long is actually -2^31 + 1 (-2147483647).

TIMESTAMP When a value is inserted into a TIMESTAMP column by the


Paradox driver, then subsequently retrieved from the column,
the retrieved value may differ from the inserted value by as
much as 1 second because of rounding.

More limitations on data types can be found in Data Type Limitations.


SQLGetInfo Returned Values for Paradox
12/20/2017 • 2 min to read • Edit Online

The following table lists the C -language #defines for the fInfoType argument and the corresponding values
returned by SQLGetInfo. This information can be retrieved by passing the listed C -language #defines to
SQLGetInfo in the fInfoType argument. For more information about the values returned by SQLGetInfo, see the
ODBC Programmer's Reference.

NOTE
Where SQLGetInfo returns a 32-bit bitmask, a vertical bar (|) represents a bitwise OR.

INFOTYPE RETURNED VALUE

SQL_ACCESSIBLE_PROCEDURES "N"

SQL_ACCESSIBLE_TABLES "Y"

SQL_ACTIVE_ENVIRONMENTS 0

SQL_AGGREGATE_FUNCTIONS All set

SQL_ALTER_DOMAIN 0

SQL_ALTER_TABLE Multiple values

SQL_ASYNC_MODE 0

SQL_BATCH_ROW_COUNT 0

SQL_BATCH_SUPPORT 0

SQL_BOOKMARK_PERSISTENCE Multiple values

SQL_CATALOG_LOCATION SQL_QL_START

SQL_CATALOG_NAME "Y"

SQL_CATALOG_NAME_SEPARATOR "\"

SQL_CATALOG_TERM "Directory"

SQL_CATALOG_USAGE Multiple values

SQL_COLLATION_SEQ ""

SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE

SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL

SQL_CONVERT_BIGINT 0

SQL_CONVERT_BINARY Multiple values

SQL_CONVERT_BIT 0

SQL_CONVERT_CHAR Multiple values

SQL_CONVERT_DATE Multiple values

SQL_CONVERT_DECIMAL 0

SQL_CONVERT_DOUBLE Multiple values

SQL_CONVERT_FLOAT Multiple values

SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT

SQL_CONVERT_INTEGER Multiple values

SQL_CONVERT_LONGVARBINARY Multiple values

SQL_CONVERT_LONGVARCHAR Multiple values

SQL_CONVERT_NUMERIC Multiple values

SQL_CONVERT_REAL Multiple values

SQL_CONVERT_SMALLINT Multiple values

SQL_CONVERT_TIME Multiple values

SQL_CONVERT_TIMESTAMP Multiple values

SQL_CONVERT_TINYINT Multiple values

SQL_CONVERT_VARBINARY Multiple values

SQL_CONVERT_VARCHAR Multiple values

SQL_CORRELATION_NAME SQL_CN_ANY

SQL_CREATE_ASSERTION 0

SQL_CREATE_CHARACTER_SET 0

SQL_CREATE_COLLATION 0
INFOTYPE RETURNED VALUE

SQL_CREATE_DOMAIN 0

SQL_CREATE_SCHEMA 0

SQL_CREATE_TABLE SQL_CT_CREATE_TABLE

SQL_CREATE_TRANSLATION 0

SQL_CREATE_VIEW 0

SQL_CURSOR_COMMIT_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_ROLLBACK_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_SENSITIVITY SQL_UNSPECIFIED

SQL_DATA_SOURCE_NAME The DSN from Odbc.ini, or "" if DRIVER keyword is used in


Odbc.ini

SQL_DATA_SOURCE_READ_ONLY "N" (This depends on the data source.)

SQL_DATABASE_NAME Current database directory

SQL_DATETIME_LITERALS 0

SQL_DBMS_NAME "PARADOX"

SQL_DBMS_VER Multiple values

SQL_DDL_INDEX Multiple values

SQL_DEFAULT_TXN_ISOLATION 0

SQL_DESCRIBE_PARAMETER 0

SQL_DRIVER_HDBC Handled by the Driver Manager.

SQL_DRIVER_HENV Handled by the Driver Manager.

SQL_DRIVER_HLIB Handled by the Driver Manager.

SQL_DRIVER_HSTMT Handled by the Driver Manager.

SQL_DRIVER_NAME "OdbcJt32.dll"

SQL_DRIVER_ODBC_VER "3.51.0000"

SQL_DRIVER_VER "4.00.nnnn" (nnnn specifies the build date)

SQL_DROP_ASSERTION 0
INFOTYPE RETURNED VALUE

SQL_DROP_CHARACTER_SET 0

SQL_DROP_COLLATION 0

SQL_DROP_DOMAIN 0

SQL_DROP_SCHEMA 0

SQL_DROP_TABLE SQL_DT_DROP_TABLE

SQL_DROP_TRANSLATION 0

SQL_DROP_VIEW SQL_DV_DROP_VIEW

SQL_EXPRESSIONS_IN_ORDERBY "Y"

SQL_FILE_USAGE SQL_FILE_TABLE

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT

SQL_GETDATA_EXTENSIONS Multiple values

SQL_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT

SQL_IDENTIFIER_CASE SQL_IC_MIXED

SQL_IDENTIFIER_QUOTE_CHAR "`" (back quote)

SQL_KEYWORDS Multiple values

SQL_LIKE_ESCAPE_CLAUSE "N"

SQL_MAX_BINARY_LITERAL_LEN 255

SQL_MAX_CATALOG_NAME_LEN 66

SQL_MAX_CHAR_LITERAL_LEN 255

SQL_MAX_COLUMN_NAME_LEN 25

SQL_MAX_COLUMNS_IN_GROUP_BY 10

SQL_MAX_COLUMNS_IN_INDEX 0 (Limit Unknown or Not Applicable)

SQL_MAX_COLUMNS_IN_ORDER_BY 10

SQL_MAX_COLUMNS_IN_SELECT 255

SQL_MAX_COLUMNS_IN_TABLE 255
INFOTYPE RETURNED VALUE

SQL_MAX_CONCURRENT_ACTIVITIES 0

SQL_MAX_CURSOR_NAME_LEN 64

SQL_MAX_DRIVER_CONNECTIONS 64

SQL_MAX_INDEX_SIZE 1350

SQL_MAX_PROCEDURE_NAME_LEN 0

SQL_MAX_ROW_SIZE 1350

SQL_MAX_ROW_SIZE_INCLUDES_LONG "N"

SQL_MAX_SCHEMA_NAME_LEN 0

SQL_MAX_STATEMENT_LEN 65000

SQL_MAX_TABLE_NAME_LEN 12

SQL_MAX_TABLES_IN_SELECT 16

SQL_MAX_USER_NAME_LEN 0

SQL_MULT_RESULT_SETS "N"

SQL_MULTIPLE_ACTIVE_TXN "Y"

SQL_NEED_LONG_DATA_LEN "N"

SQL_NON_NULLABLE_COLUMNS SQL_NNC_NON_NULL

SQL_NULL_COLLATION SQL_NC_LOW

SQL_NUMERIC_FUNCTIONS Multiple values

SQL_ODBC_SAG_CLI_ CONFORMANCE SQL_OSCC_COMPLIANT

SQL_ODBC_SQL_INTEGRITY "N"

SQL_ODBC_VER From Driver Manager

SQL_OJ_CAPABILITIES Multiple values

SQL_ORDER_BY_COLUMNS_IN_SELECT "N"

SQL_OUTER_JOINS "Y"

SQL_PROCEDURE_TERM ""
INFOTYPE RETURNED VALUE

SQL_PROCEDURES "N"

SQL_QUOTED_IDENTIFIER_CASE SQL_IC_MIXED

SQL_ROW_UPDATES "N"

SQL_SCHEMA_TERM ""

SQL_SCHEMA_USAGE 0

SQL_SCROLL_OPTIONS Multiple values

SQL_SEARCH_PATTERN_ESCAPE "\"

SQL_SERVER_NAME "PARADOX"

SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"

SQL_STRING_FUNCTIONS Multiple values

SQL_SUBQUERIES Multiple values

SQL_SYSTEM_FUNCTIONS 0

SQL_TABLE_TERM "TABLE"

SQL_TIMEDATE_ADD_INTERVALS 0

SQL_TIMEDATE_DIFF_INTERVALS 0

SQL_TIMEDATE_FUNCTIONS Multiple values

SQL_TXN_CAPABLE SQL_TC_NONE

SQL_TXN_ISOLATION_OPTION 0

SQL_UNION Multiple values

SQL_USER_NAME ""
Other Paradox Driver Programming Details
12/20/2017 • 1 min to read • Edit Online

NOTE
This section provides Paradox Driver-specific information about ODBC functions and other programming details. For general
information about a function, see the appropriate topic under ODBC API Reference.

This section contains the following topics.


SQLColAttributes (Paradox Driver)
SQLColumns (Paradox Driver)
SQLConfigDataSource (Paradox Driver)
SQLDriverConnect (Paradox Driver)
SQLGetInfo (Paradox Driver)
SQLGetTypeInfo (Paradox Driver)
SQLSetConnectOption (Paradox Driver)
SQLStatistics (Paradox Driver)
SQLTables (Paradox Driver)
SQLTransact (Paradox Driver)
CREATE INDEX for Paradox
Multiple hstmts (Paradox Driver)
SQLColAttributes (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ATTRIBUTE COMMENTS

SQL_COLUMN_DISPLAY_SIZE For LONGVARBINARY data, SQL_COLUMN_DISPLAY_SIZE is


the maximum length of the column, not the maximum length
of the column times 2.

SQL_OWNER_NAME An empty string ("") is returned in this column because owner


name is not supported.

SQL_QUALIFIER_NAME The path to a directory is returned.

SQL_COLUMN_SEARCHABLE LONGVARBINARY and LONGVARCHAR columns are reported


as SQL_UNSEARCHABLE.

Fixed-length and variable-length binary and character data


types are searchable, even though LONGVARBINARY and
LONGVARCHAR are not.

NOTE
The above is not a complete list of the attributes returned by SQLColAttributes.
SQLColumns (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory is returned.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

NULLABLE SQL_NO_NULLS is returned for columns that participate in a


primary key or unique index.
SQLConfigDataSource (Paradox Driver)
12/20/2017 • 2 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate
topic under ODBC API Reference.

The SQLConfigDataSource function that is used to add, modify, or delete a data source dynamically uses the
following keywords.

KEYWORD DESCRIPTION

COLLATINGSEQUENCE The sequence in which the fields are sorted.

When the Paradox driver is used, the sequence can be ASCII


(default), International, Swedish-Finnish, or Norwegian-
Danish.

This sets the same option as Collating Sequence in the


setup dialog box.

DBQ The name of the database file.

This sets the same option as Database in the setup dialog


box.

DEFAULTDIR The path specification to the directory.

DESCRIPTION A description of the data in the data source.

This sets the same option as Description in the setup dialog


box.

DRIVER The path specification to the driver DLL.

DRIVERID An integer ID for the driver.

26 (Paradox 3.x)

282 (Paradox 4.x)

538 (Paradox 5.x)

EXCLUSIVE Determines whether the database will be opened in exclusive


mode (accessed by only one user at a time) or shared mode
(accessed by more than one user at a time). Can be true
(exclusive mode) or false (shared mode).

This sets the same option as Exclusive in the setup dialog


box.

FIL File type Paradox 3.x, Paradox 4.x, or Paradox 5.x


KEYWORD DESCRIPTION

FILETYPE File type for the Text driver (Text).

PAGETIMEOUT Specifies the period of time, in tenths of a second, that a


page (if not used) remains in the buffer before being
removed. The default is 600 tenths of a second (60 seconds).
Note that this option applies to all data sources that use the
ODBC driver.

This sets the same option as Page Timeout in the setup


dialog box.

PARADOXNETPATH The full path of the directory containing a Paradox lock


database, because it contains either the PDOXUSRS.net file
(in Paradox 4.x) or the PARADOX.net file (in Paradox 5.x). If
the directory does not contain one of these files, the Paradox
driver creates one. For information about these files, see the
Paradox documentation.

Before a network directory can be selected, a Paradox user


name must be entered.

This sets the same option as Select Network Directory in


the setup dialog box.

PARADOXNETSTYLE For the Paradox driver, the network access style to use when
accessing Paradox data: either "3.x" for Paradox 3.x or "4.x"
for Paradox 4.x or 5.x. Can be set to "3.x" or "4.x" if the
version is Paradox 4.x or 5.x; if the version is Paradox 3.x, the
style must be "3.x".

This sets the same option as Net Style in the setup dialog
box.

PARADOXUSERNAME For the Paradox driver, the Paradox user name.

This sets the same option as User Name in the setup dialog
box.

PWD The password.

This is an optional keyword and will never be written to the


file by the driver. It is used in a call to SQLDriverConnect
against password-secured Paradox files. The password used
will be valid whenever a table is opened. If no password is
passed in the connection string, no password is established
for that table. If tables have different passwords, more than
one cannot be opened in the same session, nor can the
tables be joined.

READONLY TRUE to make file read-only; FALSE to make file not read-
only.

This sets the same option as Read Only in the setup dialog
box.
KEYWORD DESCRIPTION

THREADS The number of background threads for the engine to use.


This value is 3, and cannot be changed.

This sets the same option as Threads in the setup dialog


box.
SQLDriverConnect (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLDriverConnect enables you to connect to a driver without creating a data source (DSN ).
The following keywords are supported in the connection string for all drivers: DSN, DBQ, and FIL.
The PWD keyword is also supported. The PWD keyword should not include any of the special characters (see
SQL_SPECIAL_CHARACTERS in SQLGetInfo Returned Values).
After a password-protected file has been opened by a user, other users are not allowed to open the same file.
The following table shows the minimum keywords required to connect to each driver, and provides an example of
keyword/value pairs used with SQLDriverConnect. For a full list of DRIVERID values, see SQLConfigDataSource.

NOTE
If DBQ or DefaultDir is not specified for the Paradox driver, the driver will connect to the current directory.

DRIVER KEYWORDS REQUIRED EXAMPLE

Paradox Driver, DriverID Driver={Microsoft Paradox Driver (*.db


)}; DBQ=c:\temp;DriverID=26
SQLGetInfo (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLGetInfo supports the SQL_FILE_USAGE information type. The returned value is a 16-bit integer that
indicates how the driver directly treats files in a data source:
SQL_FILE_NOT_SUPPORTED — The driver is not a single-tier driver.
SQL_FILE_TABLE — A single-tier driver treats files in a data source as tables.
SQL_FILE_QUALIFIER — A single-tier driver treats files in a data source as a qualifier.
The ODBC driver returns SQL_FILE_TABLE because each file is a table.

SQL_ALTER_TABLE
SQL_AT_ADD_COLUMN | SQL_AT_DROP_COLUMN

SQL_DDL_INDEX
SQL_DL_CREATE_INDEX
SQL_DL_DROP_INDEX

SQL_DBMS_VER
ISAM VERSION FORMAT OF VERSION NUMBERS

Paradox 3.x 03.00.0000

4.x 04.00.0000

5.x 05.00.0000

SQL_CATALOG_USAGE
SQL_QU_DML_STATEMENTS | SQL_QU_TABLE_DEFINITION | SQL_QU_INDEX_DEFINITION

SQL_TIMEDATE_FUNCTIONS
SQL_FN_TD_DAYOFMONTH | SQL_FN_TD_DAYOFWEEK | SQL_FN_TD_DAYOFYEAR | SQL_FN_TD_HOUR |
SQL_FN_TD_MINUTE | SQL_FN_TD_MONTH | SQL_FN_TD_SECOND | SQL_FN_TD_WEEK |
SQL_FN_TD_YEAR
SQLGetTypeInfo (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

The name of the type (TYPE_NAME ) returned in the table produced by SQLGetTypeInfo will be the name most
commonly used by the data source.
SQL_ALL_EXCEPT_LIKE will be returned in the SEARCHABLE column for the Byte, Counter, Double, Single, Long,
and Short data types. (The LIKE capability can be achieved by converting the value to a character using the ODBC
canonical conversion functions, and then performing the comparison.)
SQLSetConnectOption (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

FOPTION COMMENT

SQL_ACCESS_MODE The SQL_ACCESS_MODE fOption can be set to either


SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE.
However, the driver does not prevent updates if
SQL_ACCESS_MODE is set to SQL_MODE_READ_ONLY.

SQL_AUTOCOMMIT The Paradox driver only supports SQL_AUTOCOMMIT being


set to ON (the default state), because they do not support
transactions.

SQL_CURRENT_QUALIFIER Supported.

SQL_LOGIN_TIMEOUT Not supported.

SQL_OPT_TRACE Supported.

SQL_OPT_TRACEFILE Supported.

SQL_PACKET_SIZE Not supported.

SQL_QUIET_MODE Not supported.

SQL_TRANSLATE_DLL Not supported.

SQL_TRANSLATION_OPTION Not supported.

SQL_TXN_ISOLATION Not supported.


SQLStatistics (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory.

Pattern matching is not supported in the szTableQualifier


argument.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

TABLE_NAME Undelimited table name.

Pattern matching is not supported in the szTableName


argument.

INDEX_QUALIFIER NULL is always returned.

INDEX_NAME Index-dependent.

TYPE Only SQL_TABLE_STAT or SQL_INDEX_OTHER will be returned


for TYPE.

SEQ_IN_INDEX Index-dependent.

COLUMN_NAME Index-dependent.

COLLATION Index-dependent.

PAGES NULL is always returned.

Filtering is based on uniqueness (the fUnique argument). The fAccuracy parameter is ignored.
SQLTables (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ARGUMENT COMMENTS

szTableOwner The only valid argument for szTableOwner is NULL because


none of the drivers support owner names. With szTableOwner
set to NULL, all tables are returned. NULL is returned in the
TABLE_OWNER column.

szTableQualifier In the TABLE_QUALIFIER column, SQLTables will return the


path to a directory.

SzTableType For Paradox files, "TABLE" is the only table type supported.

See Also
SQLTables Function
SQLTransact (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

This function supports SQL_COMMIT, but not SQL_ROLLBACK.


CREATE INDEX for Paradox
12/20/2017 • 2 min to read • Edit Online

The syntax of the CREATE INDEX statement for the ODBC Paradox driver is:
CREATE [UNIQUE ] INDEX index-name
ON table-name
( column-identifier [ASC ]
[, column-identifier [ASC ]...])
The ODBC Paradox driver does not support the DESC keyword in the ODBC SQL grammar for the CREATE
INDEX statement. The table-name argument can specify the full path of the table.
If the keyword UNIQUE is specified, the ODBC Paradox driver will create a unique index. The first unique index is
created as a primary index. This is a Paradox primary key file named table-name.PX. Primary indexes are subject to
the following restrictions:
The primary index must be created before any rows are added to the table.
A primary index must be defined upon the first "n" columns in a table.
Only one primary index is allowed per table.
A table cannot be updated by the Paradox driver if a primary index is not defined on the table. (Note that
this is not true for an empty table, which can be updated even if a unique index is not defined on the table.)
The index-name argument for a primary index must be the same as the base name of the table, as required
by Paradox.
If the keyword UNIQUE is omitted, the ODBC Paradox driver will create a non-unique index. This consists
of two Paradox secondary index files named table-name.Xnn and table-name.Ynn, where nn is the number
of the column in the table. Non-unique indexes are subject to the following restrictions:
Before a non-unique index can be created for a table, a primary index must exist for that table.
For Paradox 3.x, the index-name argument for any index other than a primary index (unique or non-unique)
must be the same as the column name. For Paradox 4.x and 5.x, the name of such an index can be, but
doesn't have to be, the same as the column name.
Only one column can be specified for a non-unique index.
Columns cannot be added once an index has been defined on a table. If the first column of the argument list
of a CREATE TABLE statement creates an index, a second column cannot be included in the argument list.
For example, to use the sales order number and line number columns as the unique index on the SO_LINES
table, use the statement:

CREATE UNIQUE INDEX SO_LINES


ON SO_LINES (SONum, LineNum)

To use the part number column as a non-unique index on the SO_LINES table, use the statement:
CREATE INDEX PartNum
ON SO_LINES (PartNum)

Note that when two CREATE INDEX statements are performed, the first statement will always create a primary
index with the same name as the table and the second statement will always create a non-unique index with the
same name as the column. These indexes will be named this way even if different names are entered in the
CREATE INDEX statements and even if the index is labeled UNIQUE in the second CREATE INDEX statement.

NOTE
When you use the Paradox driver without implementing the Borland Database Engine, only read and append statements are
allowed.
Multiple hstmts (Paradox Driver)
12/20/2017 • 1 min to read • Edit Online

When the ODBC Paradox driver is used, if you want to use more than one hstmt to execute queries on a table, the
table must have a unique index (Paradox primary key).
dBASE Driver Programming Considerations
12/20/2017 • 1 min to read • Edit Online

This section contains the following topics.


Setting Options Programmatically for the dBASE Driver
dBASE Data Types
SQLGetInfo Returned Values for dBASE
Other dBASE Driver Programming Details

NOTE
Accessing dBASE ISAM files through the ODBC Desktop Database Drivers requires installation of the Borland database
engine.
Setting Options Programmatically for the dBASE
Driver
12/20/2017 • 2 min to read • Edit Online

OPTION DESCRIPTION METHOD

Approximate Row Count Determines whether table size statistics To set this option dynamically, use the
are approximated. This option applies to STATISTICS keyword in a call to
all data sources that use the ODBC SQLConfigDataSource.
driver.

Collating Sequence The sequence in which the fields are To set this option dynamically, use the
sorted. COLLATINGSEQUENCE keyword in a
call to SQLConfigDataSource.
The sequence can be: ASCII (the default)
or International.

Data Source Name A name that identifies the data source, To set this option dynamically, use the
such as Payroll or Personnel. DSN keyword in a call to
SQLConfigDataSource.

Database A Microsoft Access data source can be To set this option dynamically, use the
set up without selecting or creating a DBQ keyword in a call to
database. If no database is provided SQLConfigDataSource.
upon setup, users will be prompted to
select a database file when they connect
to the data source.

Description An optional description of the data in To set this option dynamically, use the
the data source; for example, "Hire date, DESCRIPTION keyword in a call to
salary history, and current review of all SQLConfigDataSource.
employees."

Exclusive If the Exclusive box is selected, the To set this option dynamically, use the
database will be opened in Exclusive EXCLUSIVE keyword in a call to
mode and can be accessed by only one SQLConfigDataSource.
user at a time. Performance is enhanced
when it runs in Exclusive mode.

Page Timeout Specifies the period of time, in tenths of To set this option dynamically, use the
a second, that a page (if not used) PAGETIMEOUT keyword in a call to
remains in the buffer before it is SQLConfigDataSource.
removed. The default is 600 tenths of a
second (60 seconds). This option applies
to all data sources that use the ODBC
driver.

The page timeout cannot be 0 because


of an inherent delay. The page timeout
cannot be less than the inherent delay,
even if the page timeout option is set
below that value.
OPTION DESCRIPTION METHOD

Read Only Designates the database as read-only. To set this option dynamically, use the
READONLY keyword in a call to
SQLConfigDataSource.

Select Directory Displays a dialog box where you can To set this option dynamically, use the
select a directory that contains the files DEFAULTDIR keyword in a call to
you want to access. SQLConfigDataSource.

When you define a data source


directory, specify the directory where
your most frequently used files are
located. The ODBC driver uses this
directory as the default directory. Copy
other files into this directory if they are
used frequently. Alternatively, you can
qualify file names in a SELECT statement
with the directory name:

SELECT * FROM C:\MYDIR\EMP

Or, you can specify a new default


directory by using the
SQLSetConnectOption function with
the SQL_CURRENT_QUALIFIER option.

Show Deleted Rows Specifies whether rows that have been To set this option dynamically, use the
marked as deleted can be retrieved or DELETED keyword in a call to
positioned on. If cleared, deleted rows SQLConfigDataSource.
are not displayed; if selected, deleted
rows are treated the same as non-
deleted rows. The default is cleared.
dBASE Data Types
12/20/2017 • 1 min to read • Edit Online

The following table shows how dBASE data types are mapped to ODBC SQL data types. Note that not all ODBC
SQL data types are supported.

DBASE DATA TYPE ODBC DATA TYPE

CHAR SQL_VARCHAR

DATE SQL_DATE

FLOAT[1] SQL_DOUBLE

LOGICAL SQL_BIT

MEMO SQL_LONGVARCHAR

NUMERIC (BCD) SQL_DOUBLE

OLEOBJECT[1] SQL_LONGBINARY

[1] Valid only for dBASE version 5.x


Precision in dBASE III allows numbers with up to two-digit exponents and in dBASE IV numbers with up to three-
digit exponents. Because numbers are stored as text, they are converted to numbers. If the number to convert does
not fit in a field, unexplained results may occur.
While dBASE allows a precision and a scale to be specified with a NUMERIC data type, it is not supported by the
ODBC dBASE driver. The ODBC dBASE driver always returns a precision of 15 and a scale of 0 for a NUMERIC
data type.
A column created with the Numeric data type using the ODBC dBASE driver maps to the SQL_DOUBLE ODBC
data type. Thus the data in this column is subject to rounding. This behavior is not the same as that of the
NUMERIC data type in dBASE (type N ), which is Binary Coded Decimal (BCD ).

NOTE
SQLGetTypeInfo returns ODBC SQL data types. All conversions in Appendix D of the ODBC Programmer's Reference are
supported for the ODBC SQL data types listed earlier in this topic.

The following table shows limitations on dBASE data types.

DATA TYPE DESCRIPTION

CHAR Creating a CHAR column of zero or unspecified length actually


returns a 254-byte column.

Encrypted data The dBASE driver does not support encrypted dBASE tables.
DATA TYPE DESCRIPTION

LOGICAL The dBASE driver cannot create an index on a LOGICAL


column.

MEMO The maximum length of a MEMO column is 65,500 bytes.

More limitations on data types can be found in Data Type Limitations.


SQLGetInfo Returned Values for dBASE
12/20/2017 • 2 min to read • Edit Online

The following table lists the C -language #defines for the fInfoType argument and the corresponding values
returned by SQLGetInfo. This information can be retrieved by passing the listed C -language #defines to
SQLGetInfo in the fInfoType argument. For more information about the values returned by SQLGetInfo, see the
ODBC Programmer's Reference.

NOTE
Where SQLGetInfo returns a 32-bit bitmask, a vertical bar (|) represents a bitwise OR.

INFOTYPE RETURNED VALUE

SQL_ACCESSIBLE_PROCEDURES "N"

SQL_ACCESSIBLE_TABLES "Y"

SQL_ACTIVE_ENVIRONMENTS 0

SQL_AGGREGATE_FUNCTIONS All set

SQL_ALTER_DOMAIN 0

SQL_ALTER_TABLE Multiple values

SQL_ASYNC_MODE 0

SQL_BATCH_ROW_COUNT 0

SQL_BATCH_SUPPORT 0

SQL_BOOKMARK_PERSISTENCE Multiple values

SQL_CATALOG_LOCATION SQL_QL_START

SQL_CATALOG_NAME "Y"

SQL_CATALOG_NAME_SEPARATOR "\"

SQL_CATALOG_TERM "Directory"

SQL_CATALOG_USAGE Multiple values

SQL_COLLATION_SEQ ""

SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE

SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL

SQL_CONVERT_BIGINT 0

SQL_CONVERT_BINARY Multiple values

SQL_CONVERT_BIT 0

SQL_CONVERT_CHAR Multiple values

SQL_CONVERT_DATE Multiple values

SQL_CONVERT_DECIMAL 0

SQL_CONVERT_DOUBLE Multiple values

SQL_CONVERT_FLOAT Multiple values

SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT

SQL_CONVERT_INTEGER Multiple values

SQL_CONVERT_LONGVARBINARY Multiple values

SQL_CONVERT_LONGVARCHAR Multiple values

SQL_CONVERT_NUMERIC Multiple values

SQL_CONVERT_REAL Multiple values

SQL_CONVERT_SMALLINT Multiple values

SQL_CONVERT_TIME Multiple values

SQL_CONVERT_TIMESTAMP Multiple values

SQL_CONVERT_TINYINT Multiple values

SQL_CONVERT_VARBINARY Multiple values

SQL_CONVERT_VARCHAR Multiple values

SQL_CORRELATION_NAME SQL_CN_ANY

SQL_CREATE_ASSERTION 0

SQL_CREATE_CHARACTER_SET 0

SQL_CREATE_COLLATION 0
INFOTYPE RETURNED VALUE

SQL_CREATE_DOMAIN 0

SQL_CREATE_SCHEMA 0

SQL_CREATE_TABLE SQL_CT_CREATE_TABLE

SQL_CREATE_TRANSLATION 0

SQL_CREATE_VIEW 0

SQL_CURSOR_COMMIT_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_ROLLBACK_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_SENSITIVITY SQL_UNSPECIFIED

SQL_DATA_SOURCE_NAME The DSN from Odbc.ini, or "" if DRIVER keyword is used in


Odbc.ini

SQL_DATA_SOURCE_READ_ONLY "N" (This depends on the data source.)

SQL_DATABASE_NAME Current database directory

SQL_DATETIME_LITERALS 0

SQL_DBMS_NAME "DBASE"

SQL_DBMS_VER Multiple values

SQL_DDL_INDEX Multiple values

SQL_DEFAULT_TXN_ISOLATION 0

SQL_DESCRIBE_PARAMETER 0

SQL_DRIVER_HDBC Handled by the Driver Manager.

SQL_DRIVER_HENV Handled by the Driver Manager.

SQL_DRIVER_HLIB Handled by the Driver Manager.

SQL_DRIVER_HSTMT Handled by the Driver Manager.

SQL_DRIVER_NAME "OdbcJt32.dll"

SQL_DRIVER_ODBC_VER "3.51.0000"

SQL_DRIVER_VER "4.00.nnnn" (nnnn specifies the build date)

SQL_DROP_ASSERTION 0
INFOTYPE RETURNED VALUE

SQL_DROP_CHARACTER_SET 0

SQL_DROP_COLLATION 0

SQL_DROP_DOMAIN 0

SQL_DROP_SCHEMA 0

SQL_DROP_TABLE SQL_DT_DROP_TABLE

SQL_DROP_TRANSLATION 0

SQL_DROP_VIEW SQL_DV_DROP_VIEW

SQL_EXPRESSIONS_IN_ORDERBY "Y"

SQL_FILE_USAGE SQL_FILE_TABLE

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT

SQL_GETDATA_EXTENSIONS Multiple values

SQL_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT

SQL_IDENTIFIER_CASE SQL_IC_UPPER (The qualifier is returned in mixed case so that


Windows NT can locate the directory.)

SQL_IDENTIFIER_QUOTE_CHAR "`" (back quote)

SQL_KEYWORDS Multiple values

SQL_LIKE_ESCAPE_CLAUSE "N"

SQL_MAX_BINARY_LITERAL_LEN 255

SQL_MAX_CATALOG_NAME_LEN 66

SQL_MAX_CHAR_LITERAL_LEN 254

SQL_MAX_COLUMN_NAME_LEN 10

SQL_MAX_COLUMNS_IN_GROUP_BY 10

SQL_MAX_COLUMNS_IN_INDEX 0 (Limit Unknown or Not Applicable)

SQL_MAX_COLUMNS_IN_ORDER_BY 10

SQL_MAX_COLUMNS_IN_SELECT 255

SQL_MAX_COLUMNS_IN_TABLE 255
INFOTYPE RETURNED VALUE

SQL_MAX_CONCURRENT_ACTIVITIES 0

SQL_MAX_CURSOR_NAME_LEN 64

SQL_MAX_DRIVER_CONNECTIONS 64

SQL_MAX_INDEX_SIZE 220

SQL_MAX_PROCEDURE_NAME_LEN 0

SQL_MAX_ROW_SIZE 4000

SQL_MAX_ROW_SIZE_INCLUDES_LONG "N"

SQL_MAX_SCHEMA_NAME_LEN 0

SQL_MAX_STATEMENT_LEN 65000

SQL_MAX_TABLE_NAME_LEN 12

SQL_MAX_TABLES_IN_SELECT 16

SQL_MAX_USER_NAME_LEN 0

SQL_MULT_RESULT_SETS "N"

SQL_MULTIPLE_ACTIVE_TXN "Y"

SQL_NEED_LONG_DATA_LEN "N"

SQL_NON_NULLABLE_COLUMNS SQL_NNC_NON_NULL

SQL_NULL_COLLATION SQL_NC_LOW

SQL_NUMERIC_FUNCTIONS Multiple values

SQL_ODBC_SAG_CLI_ CONFORMANCE SQL_OSCC_COMPLIANT

SQL_ODBC_SQL_INTEGRITY "N"

SQL_ODBC_VER From Driver Manager

SQL_OJ_CAPABILITIES Multiple values

SQL_ORDER_BY_COLUMNS_IN_SELECT "N"

SQL_OUTER_JOINS "Y"

SQL_PROCEDURE_TERM ""
INFOTYPE RETURNED VALUE

SQL_PROCEDURES "N"

SQL_QUOTED_IDENTIFIER_CASE SQL_IC_MIXED

SQL_ROW_UPDATES "N"

SQL_SCHEMA_TERM ""

SQL_SCHEMA_USAGE 0

SQL_SCROLL_OPTIONS Multiple values

SQL_SEARCH_PATTERN_ESCAPE "\"

SQL_SERVER_NAME "DBASE"

SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"

SQL_STRING_FUNCTIONS Multiple values

SQL_SUBQUERIES Multiple values

SQL_SYSTEM_FUNCTIONS 0

SQL_TABLE_TERM "TABLE"

SQL_TIMEDATE_ADD_INTERVALS 0

SQL_TIMEDATE_DIFF_INTERVALS 0

SQL_TIMEDATE_FUNCTIONS Multiple values

SQL_TXN_CAPABLE SQL_TC_NONE

SQL_TXN_ISOLATION_OPTION 0

SQL_UNION Multiple values

SQL_USER_NAME ""
Other dBASE Driver Programming Details
12/20/2017 • 1 min to read • Edit Online

NOTE
This section provides dBASE Driver-specific information about ODBC functions and other programming details. For general
information about a function, see the appropriate topic under ODBC API Reference.

This section contains the following topics:


SQLColAttributes (dBASE Driver)
SQLColumns (dBASE Driver)
SQLConfigDataSource (dBASE Driver)
SQLDriverConnect (dBASE Driver)
SQLGetInfo (dBASE Driver)
SQLGetTypeInfo (dBASE Driver)
SQLSetConnectOption (dBASE Driver)
SQLStatistics (dBASE Driver)
SQLTables (dBASE Driver)
SQLTransact (dBASE Driver)
dBASE Indexes (dBASE Driver)
SQLColAttributes (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ATTRIBUTE COMMENTS

SQL_COLUMN_DISPLAY_SIZE For LONGVARBINARY data, SQL_COLUMN_DISPLAY_SIZE is


the maximum length of the column, not the maximum length
of the column times 2.

SQL_OWNER_NAME An empty string ("") is returned in this column because owner


name is not supported.

SQL_QUALIFIER_NAME The path to a directory is returned.

SQL_COLUMN_SEARCHABLE LONGVARBINARY and LONGVARCHAR columns are reported


as SQL_UNSEARCHABLE.

Fixed-length and variable-length binary and character data


types are searchable, even though LONGVARBINARY and
LONGVARCHAR are not.

NOTE
The above is not a complete list of the attributes returned by SQLColAttributes.
SQLColumns (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory is returned.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

NULLABLE SQL_NO_NULLS is returned for columns that participate in a


primary key or unique index.
SQLConfigDataSource (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate
topic under ODBC API Reference.

The SQLConfigDataSource function that is used to add, modify, or delete a data source dynamically uses the
following keywords.

KEYWORD DESCRIPTION

COLLATINGSEQUENCE The sequence in which the fields are sorted.

The sequence can be: ASCII (the default) or International.

This sets the same option as Collating Sequence in the


setup dialog box.

DEFAULTDIR The path specification to the directory.

DELETED For the dBASE driver, specifies whether or not rows that have
been marked as deleted can be retrieved or positioned on. If
set to 1, deleted rows are not displayed; if set to 0, deleted
rows are treated the same as non-deleted rows.

This sets the same option as Show Deleted Rows in the


setup dialog box.

DESCRIPTION A description of the data in the data source.

This sets the same option as Description in the setup dialog


box.

DRIVER The path specification to the driver DLL.

DRIVERID An integer ID for the driver.

21 (dBASE III)

277 (dBASE IV)

533 (dBASE 5.0)

FIL File type dBase III, dBase IV, or dBase 5


KEYWORD DESCRIPTION

PAGETIMEOUT Specifies the period of time, in tenths of a second, that a


page (if not used) remains in the buffer before being
removed. The default is 600 tenths of a second (60 seconds).
Note that this option applies to all data sources that use the
ODBC driver.

This sets the same option as Page Timeout in the setup


dialog box.

READONLY TRUE to make file read-only; FALSE to make file not read-
only.

This sets the same option as Read Only in the setup dialog
box.

STATISTICS For the dBASE driver, determines whether table size statistics
are approximated. Note that this option applies to all data
sources that use the ODBC driver.

This sets the same option as Approximate Row Count in


the setup dialog box.

THREADS The number of background threads for the engine to use.


This value is 3 and cannot be changed.

This sets the same option as Threads in the setup dialog


box.
SQLDriverConnect (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLDriverConnect enables you to connect to a driver without creating a data source (DSN ).
The following keywords are supported in the connection string for all drivers: DSN, DBQ, and FIL.
When the Paradox driver is used, after a password-protected file has been opened by a user, other users are not
allowed to open the same file.
The following table shows the minimum keywords required to connect to each driver, and provides an example of
keyword/value pairs used with SQLDriverConnect. For a full list of DRIVERID values, see SQLConfigDataSource.

NOTE
If DBQ or DefaultDir is not specified for the dBASEdriver, the driver will connect to the current directory.

DRIVER KEYWORDS REQUIRED EXAMPLES

dBASE Driver, DriverID Driver={Microsoft dBASE Driver (*.dbf )};


DBQ=c:\temp; DriverID=277
SQLGetInfo (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLGetInfo supports the SQL_FILE_USAGE information type. The returned value is a 16-bit integer that
indicates how the driver directly treats files in a data source:
SQL_FILE_NOT_SUPPORTED — The driver is not a single-tier driver.
SQL_FILE_TABLE — A single-tier driver treats files in a data source as tables.
SQL_FILE_QUALIFIER — A single-tier driver treats files in a data source as a qualifier.
The ODBC driver returns SQL_FILE_TABLE because each file is a table.

SQL_ALTER_TABLE
SQL_AT_ADD_COLUMN | SQL_AT_DROP_COLUMN

SQL_DBMS_VER
ISAM VERSION FORMAT OF VERSION NUMBERS

DBASE 3.0 03.00.0000

4.0 04.00.0000

5.0 05.00.0000

SQL_DDL_INDEX
SQL_DL_CREATE_INDEX
SQL_DL_DROP_INDEX

SQL_CATALOG_USAGE
SQL_QU_DML_STATEMENTS | SQL_QU_TABLE_DEFINITION | SQL_QU_INDEX_DEFINITION

SQL_TIMEDATE_FUNCTIONS
SQL_FN_TD_DAYOFMONTH | SQL_FN_TD_DAYOFWEEK | SQL_FN_TD_DAYOFYEAR | SQL_FN_TD_HOUR |
SQL_FN_TD_MINUTE | SQL_FN_TD_MONTH | SQL_FN_TD_SECOND | SQL_FN_TD_WEEK |
SQL_FN_TD_YEAR
SQLGetTypeInfo (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

The name of the type (TYPE_NAME ) returned in the table produced by SQLGetTypeInfo will be the name most
commonly used by the data source.
SQL_ALL_EXCEPT_LIKE will be returned in the SEARCHABLE column for the Byte, Counter, Double, Single, Long,
and Short data types. (The LIKE capability can be achieved by converting the value to a character using the ODBC
canonical conversion functions, then performing the comparison.)
SQLSetConnectOption (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

FOPTION COMMENT

SQL_ACCESS_MODE The SQL_ACCESS_MODE fOption can be set to either


SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE.
However, the driver does not prevent updates if
SQL_ACCESS_MODE is set to SQL_MODE_READ_ONLY.

SQL_AUTOCOMMIT The dBASE driver only supports SQL_AUTOCOMMIT being set


to ON (the default state), because it does not support
transactions.

SQL_CURRENT_QUALIFIER Supported.

SQL_LOGIN_TIMEOUT Not supported.

SQL_OPT_TRACE Supported.

SQL_OPT_TRACEFILE Supported.

SQL_PACKET_SIZE Not supported.

SQL_QUIET_MODE Not supported.

SQL_TRANSLATE_DLL Not supported.

SQL_TRANSLATION_OPTION Not supported.

SQL_TXN_ISOLATION Not supported.


SQLStatistics (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory.

Pattern matching is not supported in the szTableQualifier


argument.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

TABLE_NAME Undelimited table name.

Pattern matching is not supported in the szTableName


argument.

INDEX_QUALIFIER NULL is always returned.

INDEX_NAME Index-dependent.

TYPE Only SQL_TABLE_STAT or SQL_INDEX_OTHER will be returned


for TYPE.

SEQ_IN_INDEX Index-dependent.

COLUMN_NAME Index-dependent.

COLLATION Index-dependent.

PAGES NULL is always returned.

Filtering is based on uniqueness (the fUnique argument). The fAccuracy parameter is ignored.
SQLTables (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ARGUMENT COMMENTS

szTableOwner The only valid argument for szTableOwner is NULL because


none of the drivers supports owner names. With
szTableOwner set to NULL, all tables are returned. NULL is
returned in the TABLE_OWNER column.

szTableQualifier In the TABLE_QUALIFIER column, SQLTables will return the


path to a directory.

SzTableType For dBASE files, "TABLE" is the only table type supported.
SQLTransact (dBASE Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

This function supports SQL_COMMIT, but not SQL_ROLLBACK.


dBASE Indexes
12/20/2017 • 1 min to read • Edit Online

The ODBC dBASE driver automatically opens and updates dBASE IV index files. You must use the Select Indexes
dialog box displayed through the ODBC Data Source Administrator to associate dBASE III .ndx files with dBASE
files.
The following limitations apply to the creation of dBASE indexes:
All column names must be valid.
All columns must be in the same ascending or descending order.
The length of any single text column must be less than 100 bytes.
If more than one column exists, all of the columns must be text columns and the sum of the column sizes
must be less than 100 bytes.
Memo fields cannot be indexed.
An index must not be specified for the current set of fields (that is, duplicate indexes are not allowed).
The index name must match the dBASE index naming convention. dBASE III requires that each index be in a
separate file, each having an .ndx extension. In dBASE IV, indexes are created as tag names that are stored in
a single .mdx file. The .mdx file has the same base name as the database file (for example, Emp.mdx is the
index file for the Emp.dbf database).
dBASE defines a unique index as one where only one record from a set with identical key values is added to
the index.
Text File Driver Programming Considerations
12/20/2017 • 1 min to read • Edit Online

This section contains the following topics:


Setting Options Programmatically for the Text File Driver
Text File Data Types
SQLGetInfo Returned Values for Text Files
Other Text File Driver Programming Details
Setting Options Programmatically for the Text File
Driver
12/20/2017 • 2 min to read • Edit Online

OPTION DESCRIPTION METHOD

Data Source Name A name that identifies the data source, To set this option dynamically, use the
such as Payroll or Personnel. DSN keyword in a call to
SQLConfigDataSource.

Define Format Displays the Define Text Format This option cannot be set dynamically
dialog box and enables you to specify by a call to SQLConfigDataSource.
the schema for individual tables in the
data source directory.

Description An optional description of the data in To set this option dynamically, use the
the data source; for example, "Hire date, DESCRIPTION keyword in a call to
salary history, and current review of all SQLConfigDataSource.
employees."

Directory Selects the targeted directory. To set this option dynamically, use the
DEFAULTDIR keyword in a call to
SQLConfigDataSource.

Extensions List Lists the file name extensions of the text To set this option dynamically, use the
files on the data source. When the Text EXTENSIONS keyword in a call to
driver is used, a file with no extension is SQLConfigDataSource.
created when the CREATE TABLE
statement is executed with a name that
has no extension. Other drivers create a
file with a default extension when no
extension is provided. To create a file
with a .txt extension, the extension
must be included in the name. To
display files without extensions in the
Define Text Format dialog box, "*."
must be added to the Extensions List.

Read Only Designates the database as read-only. To set this option dynamically, use the
READONLY keyword in a call to
SQLConfigDataSource.
OPTION DESCRIPTION METHOD

Rows to Scan The number of rows to scan to To set this option dynamically, use the
determine the data type of each MAXSCANROWS keyword in a call to
column. The data type is determined SQLConfigDataSource.
given the maximum number of kinds of
data found. If data is encountered that
does not match the data type guessed
for the column, the data type will be
returned as a NULL value.

For the Text driver, you may enter a


number from 1 to 32767 for the
number of rows to scan; however, the
value will always default to 25. (A
number outside the limit will return an
error.)

Select Directory Displays a dialog box where you can To set this option dynamically, use the
select a directory containing the files DEFAULTDIR keyword in a call to
you want to access. SQLConfigDataSource.

When defining a data source directory


specify the directory where your most
commonly used files are located. The
ODBC driver uses this directory as the
default directory. Copy other files into
this directory if they are used
frequently. Alternatively, you can qualify
file names in a SELECT statement with
the directory name:
SELECT * FROM C:\MYDIR\EMP

Or, you can specify a new default


directory by using the
SQLSetConnectOption function with
the SQL_CURRENT_QUALIFIER option.
Text File Data Types
12/20/2017 • 2 min to read • Edit Online

The following table shows how text data types are mapped to ODBC SQL data types. Note that not all ODBC SQL
data types are supported by the ODBC Text driver.

TEX T DATA TYPE ODBC DATA TYPE

CHAR SQL_VARCHAR

DATETIME SQL_TIMESTAMP

FLOAT SQL_DOUBLE

INTEGER SQL_INTEGER

LONGCHAR SQL_LONGVARCHAR

NOTE
SQLGetTypeInfo returns ODBC data types. All conversions in Appendix D of the ODBC Programmer's Reference are
supported for the SQL data types listed in the previous table.

The following table shows limitations on Text data types.

DATA TYPE DESCRIPTION

CHAR Creating a CHAR column of zero or unspecified length actually


returns a 255-bit column.

In delimited files, a CHAR column may or may not have


double quotation mark delimiters at the beginning and the
end; in fixed-length files, double quotation marks are not used
as delimiters.

DATETIME MM-DD-YY (for example, 01-17-92)

MMM-DD-YY (for example, Jan-17-92)

DD-MMM-YY (for example, 17-Jan-92)

YYYY-MM-DD (for example, 1992-01-17)

YYYY-MMM-DD (for example, 1992-Jan-17)

Mixed date separators are not allowed within a table.

The Text ISAM formats a DATETIME field in the United States


or European format, depending upon the International setting
in the Windows Control Panel.
DATA TYPE DESCRIPTION

FLOAT The maximum width includes the sign and decimal point. In
Schema.ini, the width is denoted as follows:

14.083 is FLOAT Width 6

-14.083 is FLOAT Width 7

+14.083 is FLOAT Width 7

14083. is FLOAT Width 6

ODBC always returns 8 for FLOAT columns.

FLOAT columns can also be in scientific notation, for example:

-3.04E+2 is Float Width 8

25E4 is Float Width 4

Note Decimal and scientific notation cannot be mixed in a


column.

NULL values are represented by a blank padded string in


fixed-length files, and are omitted in delimited files.

Float data can be padded with leading blanks.

INTEGER Valid values for INTEGER columns are 32767 to -32766.

In Schema.ini, the width is denoted as follows:

14083 is INTEGER Width 5

0 is INTEGER Width 1

ODBC always returns 4 for INTEGER columns.

The maximum width includes a sign. The maximum width of


an INTEGER column is 11, although the width can be greater
due to blanks that are allowed in fixed-format tables.

LONGCHAR The theoretical limit on the width of a LONGCHAR column in


either a fixed-length or delimited table is 65500K. The Text
ISAM is more likely to provide reliable support up to about
32K.

More limitations on data types can be found in Data Type Limitations.


SQLGetInfo Returned Values for Text Files
12/20/2017 • 2 min to read • Edit Online

The following table lists the C -language #defines for the fInfoType argument and the corresponding values
returned by SQLGetInfo. This information can be retrieved by passing the listed C -language #defines to
SQLGetInfo in the fInfoType argument. For more information about the values returned by SQLGetInfo, see the
ODBC Programmer's Reference.

NOTE
Where SQLGetInfo returns a 32-bit bitmask, a vertical bar (|) represents a bitwise OR.

INFOTYPE RETURNED VALUE

SQL_ACCESSIBLE_PROCEDURES "N"

SQL_ACCESSIBLE_TABLES "Y"

SQL_ACTIVE_ENVIRONMENTS 0

SQL_AGGREGATE_FUNCTIONS All set

SQL_ALTER_DOMAIN 0

SQL_ALTER_TABLE 0

SQL_ASYNC_MODE 0

SQL_BATCH_ROW_COUNT 0

SQL_BATCH_SUPPORT 0

SQL_BOOKMARK_PERSISTENCE Multiple values

SQL_CATALOG_LOCATION SQL_QL_START

SQL_CATALOG_NAME "Y"

SQL_CATALOG_NAME_SEPARATOR "\"

SQL_CATALOG_TERM "Directory"

SQL_CATALOG_USAGE Multiple values

SQL_COLLATION_SEQ ""

SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE

SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL

SQL_CONVERT_BIGINT 0

SQL_CONVERT_BINARY Multiple values

SQL_CONVERT_BIT 0

SQL_CONVERT_CHAR Multiple values

SQL_CONVERT_DATE Multiple values

SQL_CONVERT_DECIMAL 0

SQL_CONVERT_DOUBLE Multiple values

SQL_CONVERT_FLOAT Multiple values

SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT

SQL_CONVERT_INTEGER Multiple values

SQL_CONVERT_LONGVARBINARY Multiple values

SQL_CONVERT_LONGVARCHAR Multiple values

SQL_CONVERT_NUMERIC Multiple values

SQL_CONVERT_REAL Multiple values

SQL_CONVERT_SMALLINT Multiple values

SQL_CONVERT_TIME Multiple values

SQL_CONVERT_TIMESTAMP Multiple values

SQL_CONVERT_TINYINT Multiple values

SQL_CONVERT_VARBINARY Multiple values

SQL_CONVERT_VARCHAR Multiple values

SQL_CORRELATION_NAME SQL_CN_ANY

SQL_CREATE_ASSERTION 0

SQL_CREATE_CHARACTER_SET 0

SQL_CREATE_COLLATION 0
INFOTYPE RETURNED VALUE

SQL_CREATE_DOMAIN 0

SQL_CREATE_SCHEMA 0

SQL_CREATE_TABLE SQL_CT_CREATE_TABLE

SQL_CREATE_TRANSLATION 0

SQL_CREATE_VIEW 0

SQL_CURSOR_COMMIT_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_ROLLBACK_BEHAVIOR SQL_CB_CLOSE

SQL_CURSOR_SENSITIVITY SQL_UNSPECIFIED

SQL_DATA_SOURCE_NAME The DSN from Odbc.ini, or "" if DRIVER keyword is used in


Odbc.ini

SQL_DATA_SOURCE_READ_ONLY "Y"

SQL_DATABASE_NAME Current database directory

SQL_DATETIME_LITERALS 0

SQL_DBMS_NAME "TEXT"

SQL_DBMS_VER ISAM: Text

Version: 1.0

Format of version number: 01.00.0000

SQL_DDL_INDEX 0

SQL_DEFAULT_TXN_ISOLATION 0

SQL_DESCRIBE_PARAMETER 0

SQL_DRIVER_HDBC Handled by the Driver Manager.

SQL_DRIVER_HENV Handled by the Driver Manager.

SQL_DRIVER_HLIB Handled by the Driver Manager.

SQL_DRIVER_HSTMT Handled by the Driver Manager.

SQL_DRIVER_NAME "OdbcJt32.dll"

SQL_DRIVER_ODBC_VER "3.51.0000"
INFOTYPE RETURNED VALUE

SQL_DRIVER_VER "4.00.nnnn" (nnnn specifies the build date)

SQL_DROP_ASSERTION 0

SQL_DROP_CHARACTER_SET 0

SQL_DROP_COLLATION 0

SQL_DROP_DOMAIN 0

SQL_DROP_SCHEMA 0

SQL_DROP_TABLE SQL_DT_DROP_TABLE

SQL_DROP_TRANSLATION 0

SQL_DROP_VIEW SQL_DV_DROP_VIEW

SQL_EXPRESSIONS_IN_ORDERBY "Y"

SQL_FILE_USAGE SQL_FILE_TABLE

SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT

SQL_GETDATA_EXTENSIONS Multiple values

SQL_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT

SQL_IDENTIFIER_CASE SQL_IC_MIXED

SQL_IDENTIFIER_QUOTE_CHAR "`" (back quote)

SQL_KEYWORDS Multiple values

SQL_LIKE_ESCAPE_CLAUSE "N"

SQL_MAX_BINARY_LITERAL_LEN 255

SQL_MAX_CATALOG_NAME_LEN 66

SQL_MAX_CHAR_LITERAL_LEN 255

SQL_MAX_COLUMN_NAME_LEN 64

SQL_MAX_COLUMNS_IN_GROUP_BY 10

SQL_MAX_COLUMNS_IN_INDEX 0

SQL_MAX_COLUMNS_IN_ORDER_BY 10
INFOTYPE RETURNED VALUE

SQL_MAX_COLUMNS_IN_SELECT 255

SQL_MAX_COLUMNS_IN_TABLE 255

SQL_MAX_CONCURRENT_ACTIVITIES 0

SQL_MAX_CURSOR_NAME_LEN 64

SQL_MAX_DRIVER_CONNECTIONS 64

SQL_MAX_INDEX_SIZE 0

SQL_MAX_PROCEDURE_NAME_LEN 0

SQL_MAX_ROW_SIZE 65535

SQL_MAX_ROW_SIZE_INCLUDES_LONG "Y"

SQL_MAX_SCHEMA_NAME_LEN 0

SQL_MAX_STATEMENT_LEN 65000

SQL_MAX_TABLE_NAME_LEN 12

SQL_MAX_TABLES_IN_SELECT 16

SQL_MAX_USER_NAME_LEN 0

SQL_MULT_RESULT_SETS "N"

SQL_MULTIPLE_ACTIVE_TXN "Y"

SQL_NEED_LONG_DATA_LEN "N"

SQL_NON_NULLABLE_COLUMNS SQL_NNC_NON_NULL

SQL_NULL_COLLATION SQL_NC_LOW

SQL_NUMERIC_FUNCTIONS Multiple values

SQL_ODBC_SAG_CLI_ CONFORMANCE SQL_OSCC_COMPLIANT

SQL_ODBC_SQL_INTEGRITY "N"

SQL_ODBC_VER From Driver Manager

SQL_OJ_CAPABILITIES Multiple values

SQL_ORDER_BY_COLUMNS_IN_SELECT "N"
INFOTYPE RETURNED VALUE

SQL_OUTER_JOINS "Y"

SQL_PROCEDURE_TERM ""

SQL_PROCEDURES "N"

SQL_QUOTED_IDENTIFIER_CASE SQL_IC_MIXED

SQL_ROW_UPDATES "N"

SQL_SCHEMA_TERM ""

SQL_SCHEMA_USAGE 0

SQL_SCROLL_OPTIONS Multiple values

SQL_SEARCH_PATTERN_ESCAPE "\"

SQL_SERVER_NAME "TEXT"

SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"

SQL_STRING_FUNCTIONS Multiple values

SQL_SUBQUERIES Multiple values

SQL_SYSTEM_FUNCTIONS 0

SQL_TABLE_TERM "TABLE"

SQL_TIMEDATE_ADD_INTERVALS 0

SQL_TIMEDATE_DIFF_INTERVALS 0

SQL_TIMEDATE_FUNCTIONS Multiple values

SQL_TXN_CAPABLE SQL_TC_NONE

SQL_TXN_ISOLATION_OPTION 0

SQL_UNION Multiple values

SQL_USER_NAME ""
Other Text File Driver Programming Details
12/20/2017 • 1 min to read • Edit Online

NOTE
This section provides Text File Driver-specific information about ODBC functions and other programming details. For general
information about a function, see the appropriate topic under ODBC API Reference.

This section contains the following topics:


Defining Text Format (Text File Driver)
Schema (Text File Driver)
Schema.ini File (Text File Driver)
Text File Format (Text File Driver)
SQLColAttributes (Text File Driver)
SQLColumns (Text File Driver)
SQLConfigDataSource (Text File Driver)
SQLDriverConnect (Text File Driver)
SQLGetInfo (Text File Driver)
SQLGetTypeInfo (Text File Driver)
SQLSetConnectOption (Text File Driver)
SQLStatistics (Text File Driver)
SQLTables (Text File Driver)
SQLTransact (Text File Driver)
Creating and Opening Tables (Text File Driver)
Read-Only Status (Text File Driver)
Defining Text Format (Text File Driver)
12/20/2017 • 4 min to read • Edit Online

When the Text driver is used, you can use the Define Text Format dialog box to define the format for columns in a
selected file. This dialog box enables you to specify the schema for each data table. This information is written to a
Schema.ini file in the data source directory. A separate Schema.ini file is created for each text data source directory.

NOTE
The same default file format applies to all new text data tables. All files created by the CREATE TABLE statement inherit those
same default format values, which are set by selecting file format values in the Define Text Format dialog box with
<default> chosen in the Tables list. The Text driver does not change the format of an existing text file to match the format
defined in this dialog box, but returns an error when it uses the format, such as when it attempts to retrieve data from the
text file.

The following options are available in the Define Text Format dialog box:

OPTION INFORMATION

Add Adds a column using the values in Data Type, Name, and
Width from the dialog box, and if applicable, the Date
Separator value from Schema.ini.

Characters ANSI or OEM. OEM specifies a non-ANSI character set. This


defaults to OEM if the format of the item selected in the
Tables list has not been previously defined by this dialog box.

Column Name Header Indicates whether the columns of the first row of the selected
table are to be used as column names. Either TRUE or FALSE.
Defaults to FALSE if the format of the item selected in the
Tables list has not been previously defined by this dialog box.

Columns Lists the column names for each column in the selected table.
The order of the columns reflects the order of the columns in
the table. This list is enabled if a file has been selected in the
Tables list.

Data Type Can be BIT, BYTE, CHAR, CURRENCY, DATE, FLOAT, INTEGER,
LONGCHAR, SHORT, or SINGLE. Date data types can be in the
following formats: "dd-mmm-yy", "mm-dd-yy", "mmm-dd-yy",
"yyyy-mm-dd", or "yyyy-mmm-dd". "mm" denotes numbers
for months; "mmm" denotes letters for months.

Delimiter Specifies the custom delimiter character to be used to separate


columns. Enabled when the Custom Delimited format is
selected. The delimiter can be only one character in length,
and double quotation marks (") cannot be used as the
delimiter character. (The delimiter cannot be specified in
hexadecimal or decimal format.)
OPTION INFORMATION

Format Either delimited or fixed length. If delimited, indicates the type


of delimiter used: comma (CSV), tab, or special character
(custom). This defaults to CSV Delimited if the format of the
item selected in the Tables list has not been previously
defined by this dialog box.

If Format is fixed-length and Column Name Header is TRUE,


the first line must be comma-delimited.

Guess Automatically generates the column's data type, name, and


width values for the columns in the selected table by scanning
the table's contents according to the Format box selection.
Enabled when the table format is delimited. Any previously
defined columns in the Columns list are cleared and replaced
with new entries. If Column Name Header is not selected,
column names are generated automatically as "F1", "F2", and
so on. No default value is shown in the Data Type box.

This functionality works only on columns that are less than


64,513 bytes.

Modify Modifies the selected column using the values in Data Type,
Name, and Width.

Name Displays the name of the selected column. Can be used to


specify a new column name for either an existing column or a
new column.

If Column Name Header is TRUE, the column name


displayed is ignored.

Remove Deletes the selected column.

Rows to Scan The number of rows that Setup or the driver will scan when
setting the columns and column data types based upon
existing data.

You can enter a number from 1 to 32767 for the number of


rows to scan. This defaults to 25 if the format of the item
selected in the Tables list has not been previously defined by
this dialog box. (A number outside the limit will return an
error.)

Tables Contains a list of all files in the directory selected in the Text
Setup dialog box that match the list of extensions specified.

When <default> is selected, and one of the following is true,


the values of the table attributes in the Tables group are
written to Schema.ini (no other entries in Schema.ini are
touched):

- There is no Schema.ini in the specified directory.


- The Schema.ini file exists, but there is no section in
Schema.ini for one of the Text files (with the specified
extension) in the directory.
- The section for a Text file exists in Schema.ini, but the body is
empty.

When <default> is selected, the Columns group is disabled.


OPTION INFORMATION

Width The width of the column can be changed for CHAR or


LONGCHAR columns. The width defaults to 1 if the format of
the item selected in the Tables list has not been previously
defined by this dialog box.

For other data types, the width control is disabled and no


value is displayed.
Schema (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

The schema includes information about each table (text file) in a data source, including the table's format, the
number of rows to scan to determine column types, whether the first row of the table contains column names,
whether the source file is written using an OEM or ANSI codepage, and each column's name, data type, and width.
Schema.ini File (Text File Driver)
12/20/2017 • 5 min to read • Edit Online

When the Text driver is used, the format of the text file is determined by using a schema information file. The
schema information file is always named Schema.ini and always kept in the same directory as the text data source.
The schema information file provides the IISAM with information about the general format of the file, the column
name and data type information, and several other data characteristics. A Schema.ini file is always required for
accessing fixed-length data. You should use a Schema.ini file when your text table contains DateTime, Currency, or
Decimal data, or any time that you want more control over the handling of the data in the table.

NOTE
The Text ISAM will obtain initial values from the registry, not from Schema.ini. The same default file format applies to all new
text data tables. All files that were created by the CREATE TABLE statement inherit those same default format values, which
are set by selecting file format values in the Define Text Format dialog box with <default> chosen in the Tables list. If the
values in the registry differ from the values in Schema.ini, the values in the registry will be overwritten by the values from
Schema.ini.

Understanding Schema.ini Files


Schema.ini files provide schema information about the records in a text file. Each Schema.ini entry specifies one of
five characteristics of the table:
The text file name
The file format
The field names, widths, and types
The character set
Special data type conversions
The following sections discuss these characteristics.

Specifying the File Name


The first entry in Schema.ini is always the name of the text source file enclosed in square brackets. The following
example illustrates the entry for the file Sample.txt:

[Sample.txt]

Specifying the File Format


The Format option in Schema.ini specifies the format of the text file. The Text IISAM can read the format
automatically from most character-delimited files. You can use any single character as a delimiter in the file except
the double quotation mark ("). The Format setting in Schema.ini overrides the setting in the Windows Registry, file
by file. The following table lists the valid values for the Format option.
FORMAT SPECIFIER TABLE FORMAT SCHEMA.INI FORMAT STATEMENT

Tab Delimited Fields in the file are delimited by tabs. Format=TabDelimited

CSV Delimited Fields in the file are delimited by Format=CSVDelimited


commas (comma-separated values).

Custom Delimited Fields in the file are delimited by any Format=Delimited(custom character)
character you choose to input into the
dialog box. All except the double -or-
quotation marks (") are allowed,
including blank. With no delimiter specified:

Format=Delimited( )

Fixed Length Fields in the file are of a fixed length. Format=FixedLength

Specifying the Fields


You can specify field names in a character-delimited text file in two ways:
Include the field names in the first row of the table and set ColNameHeader to True.
Specify each column by number and designate the column name and data type.
You must specify each column by number and designate the column name, data type, and width for fixed-
length files.

NOTE
The ColNameHeader setting in Schema.ini overrides the FirstRowHasNames setting in the Windows Registry, file by file.

The data types of the fields can also be determined. Use the MaxScanRows option to indicate how many rows
should be scanned when determining the column types. If you set MaxScanRows to 0, the whole file is scanned.
The MaxScanRows setting in Schema.ini overrides the setting in the Windows Registry, file by file.
The following entry indicates that Microsoft Jet should use the data in the first row of the table to determine field
names and should examine the whole file to determine the data types used:

ColNameHeader=True
MaxScanRows=0

The next entry designates fields in a table by using the column number (Coln) option, which is optional for
character-delimited files and required for fixed-length files. The example shows the Schema.ini entries for two
fields, a 10-character CustomerNumber text field and a 30-character CustomerName text field:

Col1=CustomerNumber Text Width 10


Col2=CustomerName Text Width 30

The syntax of Coln is:

n=ColumnNametype [#]
Remarks
The following table describes each part of the Coln entry.

PARAMETER DESCRIPTION

ColumnName The text name of the column. If the column name contains
embedded spaces, you must enclose it in double quotation
marks.

type Data types are as follows:

Microsoft Jet data types

Bit

Byte

Short

Long

Currency

Single

Double

DateTime

Text

Memo

ODBC data types Char (same as Text)

Float (same as Double)

Integer (same as Short)

LongChar (same as Memo)

Date date format

Width The literal string value Width . Indicates that the following
number designates the width of the column (optional for
character-delimited files; required for fixed-length files).

# The integer value that designates the width of the column


(required if Width is specified).

Selecting a Character Set


You can select from two character sets: ANSI and OEM. The CharacterSet setting in Schema.ini overrides the
setting in the Windows Registry, file by file. The following example shows the Schema.ini entry that sets the
character set to ANSI:

CharacterSet=ANSI
Specifying Data Type Formats and Conversions
The Schema.ini file contains several options that you can use to specify how data is converted or displayed. The
following table lists each of these options.

OPTION DESCRIPTION

DateTimeFormat Can be set to a format string that indicates dates and times.
You should specify this entry if all date/time fields in the
import/export are handled with the same format. All Microsoft
Jet formats except A.M. and P.M. are supported. If there is no
format string, the Windows Control Panel short date picture
and time options are used.

DecimalSymbol Can be set to any single character that is used to separate the
integer from the fractional part of a number.

NumberDigits Indicates the number of decimal digits in the fractional portion


of a number.

NumberLeadingZeros Specifies whether a decimal value less than 1 and more than –
1 should contain leading zeros; this value can be either False
(no leading zeros) or True.

CurrencySymbol Indicates the currency symbol that can be used for currency
values in the text file. Examples include the dollar sign ($) and
Dm.

CurrencyPosFormat Can be set to any of the following values:

- Currency symbol prefix with no separation ($1)


- Currency symbol suffix with no separation (1$)
- Currency symbol prefix with one character separation ($ 1)
- Currency symbol suffix with one character separation (1 $)

CurrencyDigits Specifies the number of digits used for the fractional part of a
currency amount.

CurrencyNegFormat Can be one of the following values:

- ($1)
- –$1
- $–1
- $1–
- (1$)
- –1$
- 1–$
- 1$–
- –1 $
- –$ 1
- 1 $–
- $ 1–
- $ –1
- 1– $
- ($ 1)
- (1 $)

This example shows the dollar sign, but you should replace it
with the appropriate CurrencySymbol value in the actual
program.
OPTION DESCRIPTION

CurrencyThousandSymbol Indicates the single-character symbol that can be used for


separating currency values in the text file by thousands.

CurrencyDecimalSymbol Can be set to any single character that is used to separate the
whole from the fractional part of a currency amount.

NOTE
If you omit an entry, the default value in the Windows Control Panel is used.
Text File Format (Text File Driver)
12/20/2017 • 2 min to read • Edit Online

The ODBC Text driver supports both delimited and fixed-width text files. A text file consists of an optional header
line and zero or more text lines.
Although the header line uses the same format as the other lines in the text file, the ODBC Text driver interprets the
header line entries as column names, not data.
A delimited text line contains one or more data values separated by delimiters: commas, tabs, or a custom delimiter.
The same delimiter must be used throughout the file. Null data values are denoted by two delimiters in a row with
no data between them. Character strings in a delimited text line can be enclosed in double quotation marks (""). No
blanks can occur before or after delimited values.
The width of each data entry in a fixed-width text line is specified in a schema. Null data values are denoted by
blanks.
Tables are limited to a maximum of 255 fields. Field names are limited to 64 characters, and field widths are limited
to 32,766 characters. Records are limited to 65,000 bytes.
A text file can be opened only for a single user. Multiple users are not supported.
The following grammar, written for programmers, defines the format of a text file that can be read by the ODBC
text driver:

FORMAT REPRESENTATION

Non-italics Characters that must be entered as shown

italics Arguments that are defined elsewhere in the grammar

brackets ([]) Optional items

braces ({}) A list of mutually exclusive choices

vertical bars (|) Separate mutually exclusive choices

ellipses (...) Items that can be repeated one or more times

The format of a text file is:


text-file ::=
[delimited-header-line] [delimited-text-line]... end-of-file |
[fixed-width-header-line] [fixed-width-text-line]... end-of-file
delimited-header-line ::= delimited-text-line
delimited-text-line ::=
blank-line |
delimited-data [delimiter delimited-data]... end-of-line
fixed-width-header-line ::= fixed-width-text-line
fixed-width-text-line ::=
blank-line |
fixed-width-data [fixed-width-data]... end-of-line
end-of-file ::= <EOF>
blank-line ::= end-of-line
delimited-data ::= delimited-string | number | date | delimited-null
fixed-width-data ::= fixed-width-string | number | date | fixed-width-null

NOTE
The width of each column in a fixed-width text file is specified in the Schema.ini file.

end-of-line ::= <CR> | <LF> | <CR><LF>


delimited-string ::= unquoted-string | quoted-stringunquoted-string ::= [character | digit] [character | digit
| quote-character]...
quoted-string ::=
quote-character
[character | digit | delimiter | end-of-line | embedded-quoted-string]...
quote-characterembedded-quoted-string ::= quote-characterquote-character
[character | digit | delimiter | end-of-line]
quote-characterquote-characterfixed-width-string ::= [character | digit | delimiter | quote-character] ...
character ::= any character except:
delimiterdigitend-of-fileend-of-linequote-characterdigit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
delimiter ::= , | <TAB> |
custom-delimitercustom-delimiter ::= any character except:
end-of-fileend-of-linequote-character

NOTE
The delimiter in a custom-delimited text file is specified in the Schema.ini file.
quote-character ::= "
number ::= exact-number | approximate-number
exact-number ::= [+ | -] {unsigned-integer[.unsigned-integer] |
unsigned-integer. |
.unsigned-integer}
approximate-number ::= exact-number{e | E}[+ | -]unsigned-integer
unsigned-integer ::= {digit}...
date ::=
mm date-separator dd date-separator yy |
mmm date-separator dd date-separator yy |
dd date-separator mmm date-separator yy |
yyyy date-separator mm date-separator dd |
yyyy date-separator mmm date-separator dd
mm ::= digit [digit]
dd ::= digit [digit]
yy ::= digit digit
yyyy ::= digit digit digit digit
mmm ::= Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec
date-separator ::= - | / | .
delimited-null ::=

NOTE
For delimited files, a NULL is represented by no data between two delimiters.

fixed-width-null ::= <SPACE>...

NOTE
For fixed-width files, a NULL is represented by spaces.
SQLColAttributes (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ATTRIBUTE COMMENTS

SQL_COLUMN_DISPLAY_SIZE For LONGVARBINARY data, SQL_COLUMN_DISPLAY_SIZE is


the maximum length of the column, not the maximum length
of the column times 2.

SQL_OWNER_NAME An empty string ("") is returned in this column because owner


name is not supported.

SQL_QUALIFIER_NAME The path to a directory is returned.

SQL_COLUMN_SEARCHABLE LONGVARBINARY and LONGVARCHAR columns are reported


as SQL_UNSEARCHABLE.

Fixed-length and variable-length binary and character data


types are searchable, even though LONGVARBINARY and
LONGVARCHAR are not.
SQLColumns (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory is returned.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

NULLABLE SQL_NO_NULLS is returned for columns that participate in a


primary key or unique index.
SQLConfigDataSource (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate
topic under ODBC API Reference.

The SQLConfigDataSource function that is used to add, modify, or delete a data source dynamically uses the
following keywords.

KEYWORD DESCRIPTION

CHARACTERSET For the Text driver, OEM or ANSI.

COLNAMEHEADER For the Text driver, indicates whether the first record of data
will specify the column names. Either TRUE or FALSE.

DEFAULTDIR The path specification to the directory.

DESCRIPTION A description of the data in the data source.

This sets the same option as Description in the setup dialog


box.

DRIVER The path specification to the driver DLL.

DRIVERID An integer ID for the driver. 27 (Text)

EXTENSIONS Lists the file name extensions of the Text files on the data
source.

This sets the same option as Extensions List in the setup


dialog box.

FIL File type Text

FILETYPE File type for the Text driver (Text).

FORMAT For the Text driver, can be FIXEDLENGTH, TABDELIMITED,


CSVDELIMITED (by a comma), or DELIMITED() (by the special
character specified in the parentheses). The special character
is one character in length and can be in character, decimal, or
hexadecimal format.
KEYWORD DESCRIPTION

MAXSCANROWS The number of rows to be scanned when setting a column's


data type based upon existing data.

For the Text driver, you can enter a number from 1 to 32767
for the number of rows to scan; however, the value will
always default to 25. (A number outside the limit will return
an error.)

This sets the same option as Rows to Scan in the setup


dialog box.

READONLY TRUE to make file read-only; FALSE to make file not read-
only.

This sets the same option as Read Only in the setup dialog
box.
SQLDriverConnect (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLDriverConnect enables you to connect to a driver without creating a data source (DSN ).
The following keywords are supported in the connection string for all drivers: DSN, DBQ, and FIL.
The following table shows the minimum keywords required to connect to each driver, and provides an example of
keyword/value pairs used with SQLDriverConnect. For a full list of DRIVERID values, see SQLConfigDataSource.

NOTE
If DBQ or DefaultDir is not specified for the Text driver, the driver will connect to the current directory.

DRIVER KEYWORDS REQUIRED EXAMPLES

Text Driver Driver={Microsoft Text Driver


(*.txt;*.csv)}; DefaultDir=c:\temp
SQLGetInfo (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

SQLGetInfo supports the SQL_FILE_USAGE information type. The returned value is a 16-bit integer that
indicates how the driver directly treats files in a data source:
SQL_FILE_NOT_SUPPORTED — The driver is not a single-tier driver.
SQL_FILE_TABLE — A single-tier driver treats files in a data source as tables.
SQL_FILE_QUALIFIER — A single-tier driver treats files in a data source as a qualifier.
The ODBC driver returns SQL_FILE_TABLE for the Textdriver, because each file is a table.

SQL_DBMS_VER
ISAM VERSION FORMAT OF VERSION NUMBERS

Text 1.0 01.00.0000

SQL_CATALOG_USAGE
SQL_QU_DML_STATEMENTS | SQL_QU_TABLE_DEFINITION

SQL_TIMEDATE_FUNCTIONS
SQL_FN_TD_CURDATE | SQL_FN_TD_CURTIME | SQL_FN_TD_DAYOFMONTH | SQL_FN_TD_DAYOFWEEK |
SQL_FN_TD_DAYOFYEAR | SQL_FN_TD_HOUR | SQL_FN_TD_MINUTE | SQL_FN_TD_MONTH |
SQL_FN_TD_NOW | SQL_FN_TD_SECOND | SQL_FN_TD_WEEK | SQL_FN_TD_YEAR
SQLGetTypeInfo (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

The name of the type (TYPE_NAME ) returned in the table produced by SQLGetTypeInfo will be the name most
commonly used by the data source.
SQL_ALL_EXCEPT_LIKE will be returned in the SEARCHABLE column for the Byte, Counter, Double, Single, Long,
and Short data types. (The LIKE capability can be achieved by converting the value to a character using the ODBC
canonical conversion functions, then performing the comparison.)
When the Text driver is used, SQLGetTypeInfo returns a CASE_SENSITIVE value of FALSE for the text data types
(CHAR and LONGCHAR ), when the data types actually are case-sensitive.
SQLSetConnectOption (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

FOPTION COMMENT

SQL_ACCESS_MODE The SQL_ACCESS_MODE fOption can be set to either


SQL_MODE_READ_ONLY or SQL_MODE_READ_WRITE.
However, the driver does not prevent updates if
SQL_ACCESS_MODE is set to SQL_MODE_READ_ONLY.

SQL_AUTOCOMMIT The Text driver only supports SQL_AUTOCOMMIT being set to


ON (the default state), because they do not support
transactions.

SQL_CURRENT_QUALIFIER Supported.

SQL_LOGIN_TIMEOUT Not supported.

SQL_OPT_TRACE Supported.

SQL_OPT_TRACEFILE Supported.

SQL_PACKET_SIZE Not supported.

SQL_QUIET_MODE Not supported.

SQL_TRANSLATE_DLL Not supported.

SQL_TRANSLATION_OPTION Not supported.

SQL_TXN_ISOLATION Not supported.


SQLStatistics (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

COLUMN COMMENTS

TABLE_QUALIFIER The path to a directory.

Pattern matching is not supported in the szTableQualifier


argument.

TABLE_OWNER NULL is returned in this column because owner name is not


supported.

TABLE_NAME Undelimited table name.

Pattern matching is not supported in the szTableName


argument.

INDEX_QUALIFIER NULL is always returned.

INDEX_NAME Index-dependent.

TYPE Only SQL_TABLE_STAT or SQL_INDEX_OTHER will be returned


for TYPE.

SEQ_IN_INDEX Index-dependent.

COLUMN_NAME Index-dependent.

COLLATION Index-dependent.

PAGES NULL is always returned.

Filtering is based on uniqueness (the fUnique argument). The fAccuracy parameter is ignored.
SQLTables (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

ARGUMENT COMMENTS

szTableOwner The only valid argument for szTableOwner is NULL because


none of the drivers support owner names. With szTableOwner
set to NULL, all tables are returned. NULL is returned in the
TABLE_OWNER column.

szTableQualifier In the TABLE_QUALIFIER column, SQLTables will return the


path to a directory.

SzTableType "TABLE" is the only table type supported.

When the Text driver is used, the list of files returned by


SQLTables is determined by the file extensions in the
Extensions List box in the ODBC Text Setup dialog box.
SQLTransact (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.

This function supports SQL_COMMIT, but not SQL_ROLLBACK.


Creating and Opening Tables (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

When the Text driver is used, a new table is created using the format specified in Odbcinst.ini. If not specified, tables
are created in CSVDELIMITED format. By default, INTEGER columns default to 11 characters and FLOAT columns
default to 22 characters. DATE columns use the YYYY -MM -DD format. CHAR and LONGCHAR columns are the
width specified in the CREATE statement.
Read-Only Status (Text File Driver)
12/20/2017 • 1 min to read • Edit Online

When the Text driver is used, data source tables are read-only. However, applications can perform insertions for
Text tables.
Additional Supported ODBC SQL Grammar
12/20/2017 • 1 min to read • Edit Online

The ODBC drivers completely support the Minimum ODBC 2.5 grammar and the following clauses in the Core
and Extended ODBC 2.5 grammar. Additional information can be displayed by jumping to the ALTER TABLE
Statement, Correlation Names, and Procedure Invocation topics.
Approximate numeric literal (Core)
ALTER TABLE Statement (Core)
Binary literals (Extended)
Correlation Names (Core)
Procedure Invocation (Extended)
BETWEEN Predicate (Core)
CREATE INDEX Statement
Date Arithmetic
Jet: Date, Time, and Timestamp Literals
DROP INDEX Statement
Fixed-Width Text File
GROUP BY expression-list
ORDER BY expression-list
ORDER BY with GROUP BY
EXISTS predicate (Core)
IN (valuelist) (Core)
Jet: Outer Joins (Extended)
SELECT statement (Extended) (including GROUP BY, HAVING, and UNION clauses)
Subqueries (SUBSELECTs) (Core)
Scalar Functions
Table Names
ALTER TABLE Statement
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Access, dBASE, or Paradoxdriver is used, the ALTER TABLE statement is supported with add
and drop table constraint definition clauses. (ALTER TABLE statements are not supported for the Microsoft Excel
or Text drivers.)

NOTE
When you use the Paradox driver without implementing the Borland Database Engine, ALTER TABLE statements are not
supported; only read and append statements are allowed.
Correlation Names
12/20/2017 • 1 min to read • Edit Online

Correlation names are fully supported, including within the table list. For example, in the following string, E1 is the
correlation name for the table named Emp:

SELECT * FROM Emp E1


WHERE E1.LastName = 'Smith'
Procedure Invocation
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Access driver is used, procedures can be invoked from the driver by using the
SQLExecDirect or SQLPrepare function with the following syntax: {CALL procedure-name
[(parameter[,parameter]...)]}. Note that expressions are not supported as parameters to a called procedure.
If a procedure name includes a dash, the name must be delimited with back quotes (`).
A parameterized query can be called using the previous statement.
BETWEEN Predicate
12/20/2017 • 1 min to read • Edit Online

The syntax:

expression1 BETWEEN expression2 AND expression3

returns true only if expression1 is greater than or equal to expression2 and expression1 is less than or equal to
expression3.
The semantics of this syntax are different for the Desktop Database Drivers and the Microsoft Jet engine. In
Microsoft Jet SQL, expression2 can be greater than expression3 so that the statement will return TRUE only if
expression1 is greater than or equal to expression3, and expression1 is less than or equal to expression2.
CREATE INDEX Statement
12/20/2017 • 1 min to read • Edit Online

The syntax of the CREATE INDEX statement is:


CREATE [UNIQUE ] INDEX index-name ON table-name (column-identifier [ASC ][DESC ][, column-identifier
[ASC ][DESC ]...]) WITH <index option list>
where <index option list> can be: PRIMARY | DISALLOW NULL | IGNORE NULL
Only the Microsoft Access driver uses the DISALLOW NULL and IGNORE NULL index options. The dBASE and
Paradox drivers accept the syntax, but ignore the presence of either option.
When the Paradox driver is used, the CREATE INDEX statement creates Paradox primary key files and secondary
files.
This statement is not supported by the Microsoft Excel or Text drivers.
Date Arithmetic
12/20/2017 • 1 min to read • Edit Online

The driver supports adding and subtracting an integer from a DATE, TIME, or TIMESTAMP column. For a DATE
column, the integer specifies the number of days to add or subtract. For a TIME or TIMESTAMP column, the
integer specifies the number of seconds to add or subtract.
Jet: Date, Time, and Timestamp Literals
12/20/2017 • 1 min to read • Edit Online

For maximum interoperability, applications should pass date literals in the ODBC canonical format using escape-
clause syntax:
For date literals, {d 'value'}, where value is in the form "yyyy-mm-dd"
For time literals, {t 'value'}, where value is in the form "hh:mm:ss"
For timestamp literals {ts 'value'}, where value is in the form "yyyy-mm-dd hh:mm:ss[.f...]".
DROP INDEX Statement
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Access, dBASE, or Paradox driver is used, the syntax of the DROP INDEX statement is "DROP
INDEX a on b" where "a" is the name of the index and "b" is the name of the table (not DROP INDEX index-name).
When the Paradox driver is used, the DROP INDEX statement deletes Paradox secondary index files.
The DROP INDEX statement is not supported for the Microsoft Excel or Text drivers.
Fixed-Width Text File
12/20/2017 • 1 min to read • Edit Online

When the Text driver is used, the last column of a fixed-width text file can be variable length.
GROUP BY expression-list
12/20/2017 • 1 min to read • Edit Online

GROUP BY supports an expression list as well as a column name. The select list of a SELECT statement that has a
GROUP BY clause can only include expressions from the GROUP BY clause or set functions.
ORDER BY expression-list
12/20/2017 • 1 min to read • Edit Online

Expressions can be used in the ORDER BY clause. For example, in the following clauses the table is ordered by
three key expressions: a+b, c+d, and e.

SELECT * FROM emp


ORDER BY a+b,c+d,e

No ordering is allowed on set functions or an expression that contains a set function.


ORDER BY with GROUP BY
12/20/2017 • 1 min to read • Edit Online

ORDER BY can be performed on any expression in the GROUP BY expression-list or any column in the result set.
Jet: Outer Joins
12/20/2017 • 1 min to read • Edit Online

A SELECT statement can contain a list of OUTER JOIN clauses. Nested OUTER JOINS are supported. For more
information about OUTER JOINS, see the Microsoft Jet Database Engine Programmer's Guide.
Scalar Functions
12/20/2017 • 1 min to read • Edit Online

The Microsoft ODBC Desktop Database Drivers support the following scalar functions:

CONCAT LCASE RIGHT

CONVERT LEFT RTRIM

CURDATE LENGTH SUBSTRING

CURTIME LOCATE UCASE

DATABASE LTRIM USER

DAYOFMONTH MOD YEAR

DAYOFWEEK MONTH

For information about the arguments and return values of scalar functions, see Appendix F of the ODBC
Programmer's Reference.
Table Names
12/20/2017 • 1 min to read • Edit Online

When the dBASE, Microsoft Excel, Paradox, or Text driver is used, table names that occur in the FROM clause of
SELECT or DELETE, after the INTO clause in INSERT, and after UPDATE, CREATE TABLE, and DROP TABLE can
contain a valid path, primary name, and file name extension.
Use of a table name elsewhere in an SQL statement does not support the use of paths or extensions but will accept
only the primary name (for example, EMP FROM C:\ABC\EMP ).
Correlation names (aliases) can be used. For example:

SELECT *
FROM C:\ABC\EMP T1
WHERE T1.COL1 = 'aaa'
Limitations
12/20/2017 • 1 min to read • Edit Online

This section describes limitations of the ODBC Desktop Database Drivers with regard to the following topics:

FUNCTIONS STATEMENTS CLAUSES, TYPES, AND SO ON

Aggregate Function ALTER TABLE Statement Column Name

Scalar Function CALL Statement Data Type

Set Functions CREATE INDEX Statement Date Arithmetic

Sorting CREATE TABLE Statement Identifiers

CONVERT Function DELETE Statement Index Name

DROP INDEX Statement Parameterized Query

DROP TABLE Statement Reserved Words

INSERT Statement AND Predicate

SELECT DISTINCT Statement DISTINCT Keyword

SELECT Statement FROM Clause

UPDATE Statement HAVING Clause

LIKE Predicate

NOT NULL

ORDER BY Clause

Table Name

Table References

Views

WHERE Clause

WHERE CURRENT OF Clause

String
Aggregate Function Limitations
12/20/2017 • 1 min to read • Edit Online

An aggregate function and a non-aggregate column reference cannot both be used as arguments to a single SQL
statement.
Column Name Limitations
12/20/2017 • 1 min to read • Edit Online

Column names can contain any valid characters (for example, spaces). If column names contain any characters
except letters, numbers, and underscores, the name must be delimited by enclosing it in back quotes (`).
When the Microsoft Access or Microsoft Excel driver is used, column names are limited to 64 characters, and
longer names generate an error. When the Paradox driver is used, the maximum column name is 25 characters.
When the Text driver is used, the maximum column name is 64 characters, and longer names are truncated.
When the dBASE driver is used, characters with an ASCII value greater than 127 are converted to underscores.
When the Microsoft Excel driver is used, if column names are present, they must be in the first row. A name that in
Microsoft Excel would use the "!" character must be enclosed in back quotes (`). The "!" character is converted to
the "$" character, because the "!" character is not legal in an ODBC name, even when the name is enclosed in back
quotes. All other valid Microsoft Excel characters (except the pipe character (|)) can be used in a column name,
including spaces. A delimited identifier must be used for a Microsoft Excel column name to include a space.
Unspecified column names will be replaced with driver-generated names, for example, "Col1" for the first column.
The pipe character (|) cannot be used in a column name, whether the name is enclosed in back quotes or not.
When the Text driver is used, the driver provides a default name if a column name is not specified. For example, the
driver calls the first column F1, the second column F2, and so on.
Data Type Limitations
12/20/2017 • 1 min to read • Edit Online

The Microsoft ODBC Desktop Database Drivers impose the following limitations on data types:

DATA TYPE DESCRIPTION

All data types Type conversion failures might result in the affected column
being set to NULL.

BINARY Creating a zero-length BINARY column actually returns a


255-byte BINARY column.

DATE The DATE data type cannot be converted to another data


type (or itself ) by the CONVERT function.

DECIMAL (Exact Numeric) Not supported.

Floating-Point Data Types The number of decimal places in a floating-point number may
be limited by the number format set in the International
section of the Windows Control Panel.

NUMERIC Supports maximum precision and a scale of 28.

TIMESTAMP The TIMESTAMP data type cannot be converted to itself by


the CONVERT function.

TINYINT TINYINT values are always unsigned.

Zero-Length Strings When a dBASE, Microsoft Excel, Paradox, or Textdriver is used,


inserting a zero-length string into a column actually inserts a
NULL instead.
Date Arithmetic Limitations
12/20/2017 • 1 min to read • Edit Online

Date arithmetic is not supported for subtracting a DATE data type from a DATE data type.
Identifiers Limitations
12/20/2017 • 1 min to read • Edit Online

If an identifier contains a space or a special symbol, the identifier must be enclosed in back quotes. A valid name is
a string of no more than 64 characters, of which the first character must not be a space. Valid names cannot include
control characters or the following special characters: ` | # * ? [ ] . ! $ .
Do not use the reserved words listed in the SQL grammar in Appendix C of the ODBC Programmer's Reference
(or the shorthand form of these reserved words) as identifiers (that is, table or column names), unless you
surround the word in back quotes (`).
Index Name Limitations
12/20/2017 • 1 min to read • Edit Online

When the Paradox driver is used, a primary index must have the same name as the table upon which it is defined.
Other unique or non-unique indexes must have the same name as the table upon which they are defined.
Parameterized Query Limitations
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Access driver is used, a parameterized query can be called using the following syntax: CALL
query-name [(parameter[,parameter]...)].
Reserved Word Limitations
12/20/2017 • 1 min to read • Edit Online

Do not use the reserved words listed in the SQL grammar in Appendix C of the ODBC Programmer's Reference
(or the shorthand form of these reserved words) as identifiers (that is, table or column names), unless you
surround the word in back quotes (`).
Scalar Function Limitations
12/20/2017 • 1 min to read • Edit Online

Scalar functions are supported only by using the ODBC canonical format.
Set Functions Limitations
12/20/2017 • 1 min to read • Edit Online

The set functions (AVG, MAX, MIN, and SUM ) do not support the DISTINCT keyword.
Sorting Limitations
12/20/2017 • 1 min to read • Edit Online

The maximum length of a sort key in a GROUP BY clause, ORDER BY clause, SELECT DISTINCT statement, or
outer join is 255 bytes; the maximum length of all sort keys in a sort row is 65,500 bytes.
String Limitations
12/20/2017 • 1 min to read • Edit Online

The maximum length of an SQL statement string is 65,000 characters.


When the Microsoft Access driver is used, only SQL -92 string constants (with single quotation marks, not double
quotation marks) are supported.
The pipe character (|) cannot be used in a string, whether the character is enclosed in back quotes or not.
For maximum interoperability, applications should pass strings in parameters, rather than passing quoted strings.
Table Name Limitations
12/20/2017 • 1 min to read • Edit Online

Table names can contain any valid characters (for example, spaces). If table names contain any characters except
letters, numbers, and underscores, the name must be delimited by enclosing it in back quotes (`).
When the Microsoft Excel driver is used, and a table name is not qualified by a database reference, the default
database is implied. If a name in Microsoft Excel includes the "!" character, it will automatically be translated to the
"$" character instead.
The Microsoft Excel table name that references <filename> is supported for Microsoft Excel 3.0 and 4.0 files. The
Microsoft Excel table name that references <workbook-name> is supported for Microsoft Excel 5.0, 7.0, or 97 files.
When the dBASE driver is used, characters with an ASCII value greater than 127 are converted to underscores.
When the Microsoft Access driver is used, the table name is limited to 64 characters.
When the dBASE, Microsoft Excel 3.0 or 4.0, Paradox, or Text driver is used, special MS -DOS keywords CON,
AUX, LPT1, and LPT2 should not be used as table names.
Table References Limitations
12/20/2017 • 1 min to read • Edit Online

A maximum of 16 table references can be included in any query statement.


Views Limitations
12/20/2017 • 1 min to read • Edit Online

Not supported by the dBASE, Microsoft Excel, Paradox, or Text drivers.


ALTER TABLE Statement Limitations
12/20/2017 • 1 min to read • Edit Online

When the dBASE or Paradox driver is used, once an index has been created and a new record added, the structure
of the table cannot be changed by the ALTER TABLE statement unless the index is dropped and the contents of the
table are deleted.
ALTER TABLE statements are not supported for the Microsoft Excel or Text drivers.

NOTE
When you use the Paradox driver without implementing the Borland Database Engine, ALTER TABLE statements are not
supported; only read and append statements are allowed.
AND Predicate Limitations
12/20/2017 • 1 min to read • Edit Online

A maximum of 40 is supported.
CALL Statement Limitations
12/20/2017 • 1 min to read • Edit Online

(This limitation applies to the Microsoft Access driver only.)


Expressions are not supported as parameters to a called procedure.
CONVERT Function Limitations
12/20/2017 • 1 min to read • Edit Online

Type conversion failures result in the affected column being set to NULL.
Neither the DATE nor TIMESTAMP data type can be converted to another data type (or itself ) by the CONVERT
function.
CREATE INDEX Statement Limitations
12/20/2017 • 1 min to read • Edit Online

The CREATE INDEX statement is not supported for the Microsoft Excel or Text drivers.
An index can be defined on a maximum of 10 columns. If more than 10 columns are included in a CREATE INDEX
statement, the index will not be recognized and the table will be treated as though no index were created.
The dBASE driver cannot create an index on a LOGICAL column.
When the dBASE driver is used, response time on large files can be improved by building an .mdx (or .ndx) index
on the column (field) specified in the WHERE clauses of a SELECT statement. Existing .mdx indexes will
automatically be applied for =, >, <, >=, =<, and BETWEEN operators in a WHERE clause, and LIKE predicates, as
well as in join predicates.
When the dBASE driver is used, the index created by a CREATE UNIQUE INDEX statement is actually non-unique,
and duplicate values can be inserted into the indexed column. Only one record from a set with identical key values
can be added to the index.
When the Paradox driver is used, a unique index must be defined upon a contiguous subset of the columns in a
table, including the first column. A table cannot be updated by the Paradox driver if a unique index is not defined
on the table or when the Paradox driver is used without the implementation of the Borland Database Engine.
CREATE TABLE Statement Limitations
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Access, Microsoft Excel, or Paradoxdriver is used, and the length of a text or binary column is
not specified (or is specified as 0), the column length will be set to 255.
When the dBASE driver is used, and the length of a text or binary column is not specified (or is specified as 0), the
column length will be set to 254.
A maximum of 255 columns is supported.
When the Microsoft Excel driver is used on a MicrosoftExcel 5.0, 7.0, or 97 data source, a worksheet cannot be
created with the same name as a worksheet that was previously dropped. When the Microsoft Excel driver is used
to access a version 5.0, 7.0, or 97 worksheet, a DROP TABLE statement clears the worksheet, but does not delete
the worksheet name.
When the Paradox driver is used, columns cannot be added once an index has been defined on a table. If the first
column of the argument list of a CREATE TABLE statement creates an index, a second column cannot be included
in the argument list.
DELETE Statement Limitations
12/20/2017 • 1 min to read • Edit Online

The DELETE statement is not supported for the Microsoft Excel or Text driver. Note that the INSERT statement is
supported for the Text driver.
The dBASE driver does not support packing a table to remove "deleted" values.
For the Paradox driver to delete a row from a table, the table must have a unique index (Paradox primary key).
DISTINCT Keyword Limitations
12/20/2017 • 1 min to read • Edit Online

Not supported for Long Text fields (Microsoft Access) or Memo fields (dBASE ).
DROP INDEX Statement Limitations
12/20/2017 • 1 min to read • Edit Online

The DROP INDEX statement is not supported for the Microsoft Excel or Text driver.
DROP TABLE Statement Limitations
12/20/2017 • 1 min to read • Edit Online

When the Microsoft Excel 5.0, 7.0, or 97 driver is used, the DROP TABLE statement clears the worksheet but does
not delete the worksheet name. Because the worksheet name still exists in the workbook, another worksheet
cannot be created with the same name.
FROM Clause Limitations
12/20/2017 • 1 min to read • Edit Online

The maximum number of tables in a FROM clause is 16.


HAVING Clause Limitations
12/20/2017 • 1 min to read • Edit Online

The maximum number of search conditions in a HAVING clause is 40.


INSERT Statement Limitations
12/20/2017 • 1 min to read • Edit Online

Inserted data is truncated on the right without warning if it is too long to fit into the column.
Attempting to insert a value that is out of the range of a column's data type causes a NULL to be inserted into the
column.
When a dBASE, Microsoft Excel, Paradox, or Textdriver is used, inserting a zero-length string into a column actually
inserts a NULL instead.
When the Microsoft Excel driver is used, if an empty string is inserted into a column, the empty string is converted
to a NULL; a searched SELECT statement that is executed with an empty string in the WHERE clause will not
succeed on that column.
A table is not updatable by the Paradox driver under two conditions:
When a unique index is not defined on the table. This is not true for an empty table, which can be updated
with a single row even if a unique index is not defined on the table. If a single row is inserted in an empty
table that does not have a unique index, an application cannot create a unique index or insert additional data
after the single row has been inserted.
If the Borland Database Engine is not implemented, only read and append statements are allowed on the
Paradox table.
When the Text driver is used, NULL values are represented by a blank-padded string in fixed-length files,
but are represented by no spaces in delimited files. For example, in the following row containing three fields,
the second field is a NULL value:

"Smith:,, 123

When the Text driver is used, all column values can be padded with leading spaces. The length of any row must be
less than or equal to 65,543 bytes.
LIKE Predicate Limitations
12/20/2017 • 1 min to read • Edit Online

If data in a column is longer than 255 characters, the LIKE comparison will be based only on the first 255
characters.
A LIKE used in a procedure is supported only with constant patterns. The Desktop Database Drivers support SQL -
92 LIKE pattern matching.
Use of an escape clause in a LIKE predicate is not supported.
A LIKE comparison should not be performed on a column containing data of a numeric or float data type. The
results may be unpredictable. For more information, see the Microsoft Jet Database Engine Programmer's Guide.
NOT NULL Limitations
12/20/2017 • 1 min to read • Edit Online

The NOT NULL constraint in the CREATE TABLE statement is not supported.
ORDER BY Clause Limitations
12/20/2017 • 1 min to read • Edit Online

If a SELECT statement contains a GROUP BY clause and an ORDER BY clause, the ORDER BY clause can contain
only a column in the result set or an expression in the GROUP BY clause.
SELECT DISTINCT Limitations
12/20/2017 • 1 min to read • Edit Online

The DISTINCT keyword does not apply to binary data.


SELECT Statement Limitations
12/20/2017 • 1 min to read • Edit Online

An aggregate-function column cannot be mixed with a non-aggregate column in a SELECT statement.


The select list of a SELECT statement that has a GROUP BY clause can only have expressions from the GROUP BY
clause or set functions.
The use of an asterisk (to select all columns) in a SELECT statement containing a GROUP BY clause is not
supported. The names of the columns to be selected must be specified.
The use of a vertical bar in a SELECT statement is not supported. Use a parameter in the SELECT statement if you
need to refer to a data value that contains a vertical bar.
When using a column alias in a SELECT statement, the word "as" must precede the alias. For example, "SELECT
col1 as a from b." Without the "as", the statement will return an error.
If an incorrect column name is entered into a SELECT statement, a SQLSTATE 07001 error, "Wrong Number of
Parameters," is returned instead of a SQLSTATE S0022 error, "Column Not Found."
When the Microsoft Excel driver is used, if an empty string is inserted into a column, the empty string is converted
to a NULL; a searched SELECT statement that is executed with an empty string in the WHERE clause will not
succeed on that column.
UPDATE Statement Limitations
12/20/2017 • 1 min to read • Edit Online

For the Paradox driver to update a table, the table must have a unique index (Paradox primary key). When you use
the Paradox driver without implementing the Borland Database Engine, it is not possible to update a Paradox table.
Not supported by the Text driver.
When the Microsoft Excel driver is used, it is possible to update values, but a row cannot be deleted from a table
based on a Microsoft Excel spreadsheet. As a result, the UPDATE statement is not considered officially supported
by the Microsoft Excel driver. Only the INSERT statement is considered supported.
WHERE Clause Limitations
12/20/2017 • 1 min to read • Edit Online

The maximum number of clauses in a WHERE clause is 40.


LONGVARBINARY and LONGVARCHAR columns can be compared to literals of up to 255 characters in length,
but cannot be compared using parameters.
WHERE CURRENT OF Clause Limitations
12/20/2017 • 1 min to read • Edit Online

Not supported.
ODBC Errors
12/20/2017 • 1 min to read • Edit Online

When an error occurs, the Microsoft ODBC Desktop Database Drivers return the native error number, the
SQLSTATE (an ODBC error code), and an error message.
This section contains the following topics.
Native Error
SQLSTATE
Error Messages
Arithmetic Errors
Native Error
12/20/2017 • 1 min to read • Edit Online

Positive native error codes are generated by the Desktop Database Drivers. Negative error codes are generated by
Microsoft Jet. For more information, see the Microsoft Jet Database Engine Programmer's Guide.
SQLSTATE
12/20/2017 • 1 min to read • Edit Online

For errors that occur in the data source, the ODBC driver maps the returned native error to the appropriate
SQLSTATE. For errors that are detected by the driver or the Driver Manager, the ODBC driver or Driver Manager
generates the appropriate SQLSTATE.
ODBC Jet Error Messages
12/20/2017 • 1 min to read • Edit Online

For errors that occur in the data source, the ODBC driver returns an error message returned to it by the ODBC File
Library. For errors that occur in the ODBC driver or the Driver Manager, the driver returns an error message based
on the text associated with the SQLSTATE.
Error messages have the following format:

[vendor][ODBC-component][data-source]message-text

The prefixes in brackets ([ ]) identify the location of the error. When the error occurs in the Driver Manager, data -
source is not given. When the error occurs in the data source, the [vendor] and [ODBC -component] prefixes
identify the vendor and name of the ODBC component that received the error from the data source.
The following table shows the error messages returned by the Driver Manager and driver ISAM:

ERROR MESSAGE ERROR LOCATION

[Microsoft][ODBC Driver Manager] message-text Driver Manager (Odbc32.dll)

[Microsoft][ODBC driver-name]message-text Driver ISAM (see Driver ISAMs)


Arithmetic Errors
12/20/2017 • 1 min to read • Edit Online

The ODBC driver evaluates the WHERE clause in a SELECT statement as it fetches each row. If a row contains a
value that causes an arithmetic error, such as divide-by-zero or numeric overflow, the driver returns all rows, but
returns errors for columns with arithmetic errors. When inserting or updating, however, the ODBC driver stops
inserting or updating data when the first arithmetic error is encountered.
Supported ODBC API Functions
12/20/2017 • 1 min to read • Edit Online

The purpose of leveling is to inform the application what features are available to it from the driver. The Microsoft
ODBC Desktop Database Drivers support all Core and Level 1 functions.
For more information about conformance levels for functions and grammar, see Conformance Levels in the ODBC
Programmer's Reference.
Support of ODBC API functions can be dependent on the driver used. The following table summarizes the support
for functions. The leftmost column provides a link to the general reference page for each function. These reference
pages are listed alphabetically in the ODBC API Reference section, under ODBC Programmer's Reference. The
columns to the right provide links to driver-specific notes about each supported function. These driver-specific
topics are listed in the "Other Programming Details" section for each driver. Alternatively, if the same remarks
about a function apply to all the ODBC Desktop Database Drivers, the rightmost column provides a link to a topic
that summarizes the Desktop Database Drivers' support for that function. These topics are listed at the end of the
current section ("Supported ODBC API Functions").

ACCESS PARADOX TEX T FILE NOTES


ODBC DRIVER- DBASE DRIVER- DRIVER- DRIVER- EXCEL DRIVER- RELEVANT TO
FUNCTION SPECIFIC NOTES SPECIFIC NOTES SPECIFIC NOTES SPECIFIC NOTES SPECIFIC NOTES ALL DRIVERS

SQLBindPara Excel
meter

SQLColAttribu Access dBASE Paradox Text File Excel


tes

SQLColumns Access dBASE Paradox Text File Excel

SQLConfigDat Access dBASE Paradox Text File Excel


aSource

SQLDriverCon Access dBASE Paradox Text File Excel


nect

SQLGetCursor All drivers


Name

SQLGetData All drivers

SQLGetInfo Access dBASE Paradox Text File Excel

GetStmtOptio All drivers


n]
(../Topic/SQLG
etStmtOption
%20Function.
md)

SQLGetTypeIn Access dBASE Paradox Text File Excel


fo
ACCESS PARADOX TEX T FILE NOTES
ODBC DRIVER- DBASE DRIVER- DRIVER- DRIVER- EXCEL DRIVER- RELEVANT TO
FUNCTION SPECIFIC NOTES SPECIFIC NOTES SPECIFIC NOTES SPECIFIC NOTES SPECIFIC NOTES ALL DRIVERS

SQLMoreResul All drivers


ts

SQLPrepare All drivers

SQLProcedure Access
Columns

SQLProcedure All drivers


s

SQLSetConne Access dBASE Paradox Text File Excel


ctOption

SQLSetCursor All drivers


Name

SQLSetPos All drivers

SQLSetScrollO All drivers


ptions

SQLSetStmtO All drivers


ption

SQLSpecialCol All drivers


umns

SQLStatistics Access dBASE Paradox Text File Excel

SQLTables Access dBASE Paradox Text File Excel

Transact] Access dBASE Paradox Text File Excel


(../Topic/SQLTr
ansact%20Fun
ction.md)

The following topics provide remarks about ODBC functions. These remarks apply to all ODBC Desktop Database
Drivers.
SQLGetData (Desktop Database Drivers)
SQLGetStmtOption(Desktop Database Drivers)
SQLMoreResults (Desktop Database Drivers)
SQLPrepare (Desktop Database Drivers)
SQLProcedures (Desktop Database Drivers)
SQLSetCursorName (Desktop Database Drivers)
SQLSetPos (Desktop Database Drivers)
SQLSetScrollOptions (Desktop Database Drivers)
SQLSetStmtOption (Desktop Database Drivers)
SQLSpecialColumns (Desktop Database Drivers)
SQLGetCursorName (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

SQLGetCursorName is supported, but can only be used when the Cursor Library is used, because positioned
operations are not supported in the driver.
SQLGetData (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

This function can retrieve data from any column, whether or not there are bound columns after it and regardless of
the order in which the columns are retrieved.

NOTE
*pcbValue in SQLGetData may return twice as many characters as actually available when binding to ANSI data longer than
510 characters on a Jet 4.0 database. Character values of 510 or less will return the actual cbValue.
SQLGetStmtOption (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

The bookmarks returned by an fOption of SQL_GETBOOKMARK are only valid while the query is open and are
invalidated when the query is reissued. Persistent bookmarks are not supported.
SQLMoreResults (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

This function always returns SQL_NO_DATA_FOUND.


SQLPrepare (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

A statement prepared with an incorrect number of columns returns an error at execution time, not upon statement
preparation.
SQLProcedures (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

SQLProcedures will only return rows for those procedures that have at least one argument. Procedures that have
no arguments are treated as views.

COLUMN COMMENTS

PROCEDURE_QUALIFIER The path to the database file.

PROCEDURE_OWNER NULL

PROCEDURE_NAME Undelimited procedure name

PROCEDURE_TYPE SQL_PT_PROCEDURE
SQLSetCursorName (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

Because the driver does not support a positioned update or delete by the WHERE CURRENT OF cursorname
syntax, SQLSetCursorName is supported, but cannot be used for positioned updates. It can only be used when
the Cursor Library is enabled and the application is using SQLExtendedFetch.
SQLSetPos (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

The bulk-model semantics for SQLSetPos calls with the irow argument equal to 0 are supported.
SQL_LOCK_NO_CHANGE is supported for fLock. SQL_LOCK_EXCLUSIVE and SQL_LOCK_UNLOCK are not
supported.
SQLSetPos supports updatable joins. (For more information, see the Microsoft Jet Database Engine
Programmer's Guide.)
SQLSetScrollOptions (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

Forward and static cursors are supported for SQL_CONCUR_READ_ONLY.


Only keyset-driven cursors are supported for an fConcurrency argument of SQL_CONCUR_LOCK.
An fConcurrency argument of SQL_CONCUR_ROWVER is not supported.
Dynamic cursors and mixed cursors are not supported.
SQLSetStmtOption (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

FOPTION COMMENTS

SQL_ASYNC_ENABLE Asynchronous processing is not supported. The


SQL_ASYNC_ENABLE fOption will return SQLSTATE S1C00
(Driver not capable).

SQL_KEYSET_SIZE The only valid keyset size is 0, because mixed and dynamic
cursors are not supported. If this value is set to any other
number, it will be changed to 0 and the call will return
SQL_SUCCESS_WITH_INFO and SQLSTATE 01S02 (Option
value changed).

SQL_MAX_ROWS The only valid rowset size is 0, because the Desktop Database
Drivers do not support limiting the number of rows that are
returned. If this value is set to any other number, it will be
changed to 0 and the call will return
SQL_SUCCESS_WITH_INFO and SQLSTATE 01S02 (Option
value changed).

SQL_QUERY_TIMEOUT Not supported.

SQL_ROW_NUMBER Not supported.

SQL_SIMULATE_CURSOR Not supported.


SQLSpecialColumns (Desktop Database Drivers)
12/20/2017 • 1 min to read • Edit Online

A unique index will be returned (if one exists) for the SQL_BEST_ROWID flag in fColType. No result set will be
returned for the SQL_ROWVER flag.
All row IDs have a scope of SQL_SCOPE_CURROW.
Pattern matching is not supported for either the szTableQualifier or szTableName argument.
ODBC Driver for Oracle
12/20/2017 • 2 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The Microsoft® ODBC Driver for Oracle allows you to connect your ODBC -compliant application to an Oracle
database. The ODBC Driver for Oracle conforms to the Open Database Connectivity (ODBC ) specification
described in the ODBC Programmer's Reference. It allows access to PL/SQL packages, XA/DTC integration, and
Oracle access from within Internet Information Services (IIS ).
Oracle RDBMS is a multiuser relational database management system that runs with various workstation and
minicomputer operating systems. IBM -compatible computers running Microsoft Windows can communicate with
Oracle database servers over a network. Supported networks include Microsoft L AN Manager, NetWare, VINES,
DECnet, and any network that supports TCP/IP.
The ODBC Driver for Oracle enables an application to access data in an Oracle database through the ODBC
interface. The driver can access local Oracle databases or it can communicate with the network through SQL*Net.
The following diagram details this application and driver architecture.

The ODBC Driver for Oracle complies with API Conformance Level 1 and SQL Conformance Level Core. It also
supports some functions in API Conformance Level 2 and most of the grammar in the Core and Extended SQL
conformance levels. The driver is ODBC 2.5 compliant and supports 32-bit systems. Oracle 7.3x is supported fully;
Oracle8 has limited support. The ODBC Driver for Oracle does not support any of the new Oracle8 data types —
Unicode data types, BLOBs, CLOBs, and so on — nor does it support Oracle's new Relational Object Model. For
more information about supported data types, see Supported Data Types in this guide.
To access Oracle data, the following components are required:
The ODBC Driver for Oracle
An Oracle RDBMS database
Oracle Client Software
Additionally, for remote connections:
A network that connects the computers that run the driver and the database. The network must support
SQL*Net connections.

Component Documentation
This guide contains detailed information about setting up and configuring the Microsoft ODBC Driver for Oracle
and adding programmatic functionality. It also contains technical reference material.
For information regarding specific Oracle product behavior, consult the documentation that accompanies the
Oracle product.
For information about setting up or configuring the Microsoft ODBC Driver for Oracle using the ODBC Data
Source Administrator, see the ODBC Data Source Administrator documentation.
This section contains the following topics.
ODBC Driver for Oracle User's Guide
ODBC Driver for Oracle Programmer's Reference
ODBC Driver for Oracle User's Guide
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The ODBC Driver for Oracle User's Guide is intended to complement the setup help that can be accessed through
the ODBC Data Source Administrator.
This section contains the following topics.
Driver Version Scheme
Installing the Software
Oracle Software Patches
Adding and Modifying Data Sources Using Setup
Testing the ODBC Connection
Configuring the ODBC Driver for Oracle
Connecting to a Data Source
Determining Installed Oracle Components
Setting the Date Format on Connection
Driver Version Scheme
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The following table lists all released versions of the Microsoft ODBC Driver for Oracle.

DRIVER VERSION BUILD NUMBER AVAILABILITY HISTORY

1.0 2.00.6235 Visual C++ 4.2 and Visual Basic 5.0,


Enterprise Edition

2.0 2.73.7269 Visual Studio 97 and MDAC 1.5a

2.0 updated 2.73.7283.01 IIS 4.0

2.0 updated 2.73.7283.03 MDAC 1.5b and 1.5c

2.0 updated 2.73.7356 ODBC 3.5 SDK

2.5 2.573.2927 Visual Studio 6.0 and MDAC 2.0

2.5 updated 2.573.3513 SQL Server 7.0

SQL Server 6.5 SP5

Build 2.00.6235 (version 1) was the first release of the Microsoft ODBC Driver for Oracle. After the release of the
first version, a new naming convention was adopted.
For example, 2.73.7283.03 can be divided into the following distinct components:
2 = The version number.
73 = The version of Oracle Server for which the driver was designed.
7283.03 = The build number of the driver.

NOTE
With release 2.573.2973, the naming convention has led to some confusion that 2.573 is an earlier release than 2.73, but
each section of the build number should be considered individually. The number 573 is larger than 73, so it is a newer
version. Also, "2.5" indicates the driver's version number.
Installing the Software (ODBC)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The ODBC Driver for Oracle is one of the data access components. It accompanies other ODBC components, such
as the ODBC Data Source Administrator, and should already be installed. The driver also can be found under
"Drivers and Other Downloads" on the Microsoft Product Support Services Online Web site at
www.microsoft.com.
Network software must be installed according to its own documentation. The ODBC Driver for Oracle requires no
special installation considerations as long as the network software is supported.
Oracle software must be installed according to its own documentation. The ODBC Driver for Oracle generally
requires no special installation considerations as long as the driver supports the version. However, to keep
products compatible, install the ODBC Driver for Oracle last to ensure you have the latest version of the driver.
Oracle maintains a public FTP site where it posts, among other things, patches to the Oracle server products and
the client component that ships with the server products. These patches are required for the proper functioning of
several Microsoft products and technologies. For more information about this site, see Oracle Software Patches.
Cau t i on

Installing Oracle software over MDAC/Windows DAC may overwrite current versions of MDAC. If problems arise
using ODBC components, reinstall MDAC.
Oracle Software Patches
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Patches for the Oracle server products and its client component are required for the proper functioning of several
Microsoft products and technologies, including the Microsoft ODBC Driver for Oracle, the Microsoft OLE DB
Provider for Oracle, Internet Information Services (IIS ), Component Services (or Microsoft Transaction Server, if
you are using Windows NT), and so forth.

NOTE
The following instructions may not be completely accurate because the Oracle FTP site is subject to change.

To download the Oracle software patches


1. Connect to the public FTP site at oracle-ftp.oracle.com. The user ID is "anonymous" and the password is
your e-mail address.
2. Navigate to the following directory: /server/wgt_tech/server/windowsNT.
3. To download patches most relevant for Windows 95, Windows 98 and Windows NT/Windows 2000,
navigate to the subdirectory for your version of Oracle — 7.3 or 8.0. The two subdirectories are
/73patchsets and /80patchsets.
4. To download patches for Oracle's network technology, either SQL*Net or Net8, navigate to the following
directory: /network.
Accessing this FTP site from your Web browser might not work. If you experience problems, try using a
"traditional" FTP client or use the DOS command prompt.

NOTE
Because Oracle fixes bugs in current versions and then retrofits them to earlier versions using software patches, it is
recommended that you download the latest patch available. This is especially true for the Oracle Server Client components. If
you have questions about installing these patches, contact Oracle Support.
Adding and Modifying Data Sources Using Setup
12/20/2017 • 3 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

A data source identifies a path to data that can include a network library, server, database, and other attributes —
in this case, the data source is the path to an Oracle database. To connect to a data source, the Driver Manager
checks the Windows registry for specific connection information.
The registry entry created by the ODBC Data Source Administrator is used by the ODBC Driver Manager and
ODBC drivers. This entry contains information about each data source and its associated driver. Before you can
connect to a data source, its connection information must be added to the registry.
To add and configure data sources, use the ODBC Data Source Administrator. The ODBC Administrator updates
your data source connection information. As you add data sources, the ODBC Administrator updates the registry
information for you.
To add a data source for Windows
1. Open the ODBC Data Source Administrator.
2. In the ODBC Data Source Administrator dialog box, click Add. The Creat New Data Source dialog box
appears.
3. Select Microsoft ODBC for Oracle and then click Finish. The Microsoft ODBC for Oracle Setup dialog box
appears.
4. In the Data Source Name box, type the name of the data source you want to access. It can be any name that
you choose.
5. In the Description box, type the description for the driver. This optional field describes the database driver
that the data source connects to. It can be any name that you choose.
6. In the User Name box, type your database user name (your database user ID ).
7. In the Server box, type the Database Alias or connect string for the Oracle Server engine that you want to
access.
8. Click OK to add this data source.

NOTE
The Data Sources dialog box appears, and the ODBC Administrator updates the registry information. The user name and
connect string that you typed become the default connection values for this data source when you connect to it.

1. Click Options make more specifications about the ODBC Driver for Oracle setup:
Translation — Click Select to choose a loaded data translator. The default is <No Translator>.
Performance — The Include REMARKS in Catalog Functions check box specifies whether the
driver returns Remarks columns for the SQLColumns result set. The ODBC Driver for Oracle
provides faster access when this value is not set.
The Include SYNONYMS in SQL Columns check box specifies whether the driver returns column
information. Buffer Size specifies the size, in bytes, allocated to receive fetched data. The driver
optimizes fetching so that one fetch from the Oracle Server returns enough rows to fill a buffer of the
specified size. Larger values tend to increase performance when fetching a lot of data.
Customization — The Enforce ODBC DayOfWeek Standard check box specifies whether the result
set will conform to the ODBC specified day-of-week format (Sunday = 1; Saturday = 7). If this check
box is cleared, the locale-specific Oracle value is returned.
The SQLDescribeCol always returns a value for precision check box specifies whether or not the
driver should return a non-zero value for the cbColDef argument of SQLDescribeCol. This
connection string attribute applies only to columns where there is no Oracle-defined scale, such as
computed numeric columns and columns defined as NUMBER without a precision or scale. A
SQLDescribeCol call returns 130 for the precision when Oracle does not provide that information. If
this check box is cleared, the driver will return 0 for these types of columns instead.
2. Click Add to add another data source, or click Close to exit.
To modify a data source for Windows
1. Open the ODBC Data Source Administrator. Click the appropriate DSN tab.
2. Select the Oracle data source you want to modify and then click Configure. The Microsoft ODBC for Oracle
Setup dialog box appears.
3. Modify the applicable data source fields, and then click OK.
When you have finished modifying the information in this dialog box, the ODBC Administrator updates the
registry information.
Testing the ODBC Connection
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

When troubleshooting ODBC access to Oracle 7.x and Oracle8 RDBMS servers, it might be necessary to verify
that the underlying SQL*Net and Oracle Protocol Adapters are correctly installed. To do this, use the Oracle-
supplied utility Nettest.exe in the Orawin\Bin directory.
Nettest is a simple utility that attempts to log on to the selected server using only the installed SQL*Net software
that is part of the Oracle client. The utility will ask for a login name, password, and TNS connect string. If the
Oracle client is correctly installed, the utility will simply display "Ping Successful." If the login was not successful,
you will need to consult with a database administrator.
Configuring the ODBC Driver for Oracle
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

You can control performance of the ODBC Driver for Oracle by knowing the data environment and correctly
setting the parameters of the data source connection through the ODBC Data Source Administrator dialog box or
through connect string parameters. The dialog box provides the following controls for connecting to a data source
using the dialog box or using connect strings:
User DSN tab Lists the Data Source Names that are local to the computer.
System DSN tab Enables you to add or remove a system data source. System data sources can be
accessed by all users on the local computer.
File DSN tab Enables you to add or remove a file data source from the local computer. File data sources
can be shared by all users who have the same driver installed.
Drivers tab Lists the installed ODBC drivers.
Tracing tab Enables you to specify how the ODBC Driver Manager traces calls to ODBC functions. You can
configure tracing separately for each installed ODBC application.
Connection Pooling tab Enables you to select connection options for each installed driver.
About tab Lists the installed ODBC component files.
After you add a data source, you can use the ODBC Data Source Administrator dialog box to configure
the access to your data source. Select a data source, and then click one of the tabs to edit or review the
information.
Connecting to a Data Source (ODBC Driver for
Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

An ODBC application can pass connection information in a number of ways. For example, the application might
have the driver always prompt the user for connection information. Or the application might expect a connection
string that specifies the data source connection. How you connect to a data source depends on the connection
method used by your ODBC application.
One common way to connect to a data source is through the Data Source dialog box. If your ODBC application is
set up to use a dialog box, that dialog box is displayed and prompts you for the appropriate data source connection
information.
You can also connect to a data source using the connection string.
To connect to a data source using a dialog box
1. When the Data Source dialog box appears, select an Oracle data source and then click OK. The Connect
dialog box appears.
2. Fill in the appropriate information for the Connect dialog box, and then click OK.
After the connection information is verified, your application can use the ODBC Driver for Oracle to access
the information that the data source contains.
Determining Installed Oracle Components
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

To determine the Oracle components installed on your system (and their versions), navigate to the \Orainst
directory under the Oracle home directory. Open one of the following text files: Nt.rgs, Win95.rgs, or Win98.rgs.
The file format is similar to the following:

0 ntinstall all "orainst" "3.3.1.0.0C" "Oracle Installer"


20 w32tcp80 adp80 "tcp80" "8.0.5.0.0" "Oracle TCP/IP Pro"
23 w32nmp80 adp80 "nmp80" "8.0.5.0.0" "Oracle Named Pipe"
26 w32util80 all "util80" "8.0.5.0.0" "Oracle8 Utilities"
34 w32rsf80 all "rsf80" "8.0.5.0.0" "Required Support"
47 w32netclt80 net80 "netc80" "8.0.5.0.0" "Oracle Net8 Client"
69 w32plus80 all "plus80" "8.0.5.0.0" "SQL*Plus"

The .rgs files also include installation information and descriptions of each component.
Setting the Date Format on Connection
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The new version of the Microsoft ODBC Driver for Oracle does not automatically set the date format for Oracle
date fields. Previously when the driver connected, it used
ALTER SESSION SET NLS_DATE_FORMAT ='YYYY-MM-DD HH:MI:SS' .

To set the date format, call ALTER SESSION SET and then perform the insert. For example:

conn.Execute "ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH:MI:SS' "


sSql = "INSERT INTO DATETEST VALUES (24,'1988-12-01 10:23:03')"
conn.Execute sSql
ODBC Driver for Oracle Programmer's Reference
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

This section includes the following topics:


Connection String Format and Attributes
Connect Options
Statement Options
Cursor Type and Concurrency Combinations
Using Microsoft Component Services
Using Microsoft Internet Information Services
Using Operating System Authentication
Using SQLConfigDatasource with the ODBC Driver for Oracle
Limitations of Using Keyset-Driven Cursors
ODBC Driver for Oracle Stored Procedures
ODBC Driver for Oracle Error Messages
ODBC Conformance Levels
API Functions
Supported Data Types
Mapping Data Types
Connection String Format and Attributes
12/20/2017 • 3 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Instead of using a dialog box, some applications might require a connection string that specifies data source
connection information. The connection string is made up of a number of attributes that specify how a driver
connects to a data source. An attribute identifies a specific piece of information that the driver needs to know
before it can make the appropriate data source connection. Each driver might have a different set of attributes, but
the connection string format is always the same. A connection string has the following format:

"DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;<Attribute>=<value>]"

NOTE
The Microsoft ODBC Driver for Oracle supports the connection string format of the first version of the driver, which used
CONNECTSTRING = instead of SERVER= .

If you are connecting to a data source provider that supports Windows authentication, you should specify
Trusted_Connection=yes instead of user ID and password information in the connection string.

You must specify the data source name if you do not specify the UID, PWD, SERVER (or CONNECTSTRING ), and
DRIVER attributes. However, all other attributes are optional. If you do not specify an attribute, that attribute
defaults to the one specified in the relevant DSN tab of the ODBC Data Source Administrator dialog box. The
attribute value might be case-sensitive.
The attributes for the connection string are as follows:

ATTRIBUTE DESCRIPTION DEFAULT VALUE

DSN The data source name listed in the ""


Drivers tab of the ODBC Data Source
Administrator dialog box.

PWD The password for the Oracle Server that ""


you want to access. This driver
supports limitations that Oracle places
on passwords.

SERVER The connect string for the Oracle Server ""


that you want to access.
ATTRIBUTE DESCRIPTION DEFAULT VALUE

UID The Oracle Server user name. ""


Depending on your system, this
attribute might not be optional — that
is, certain databases and tables might
require this attribute for security
purposes.

Use "/" to use Oracle's operating system


authentication.

BUFFERSIZE The optimal buffer size used when 65535


fetching columns.

The driver optimizes fetching so that


one fetch from the Oracle Server
returns enough rows to fill a buffer of
this size. Larger values tend to increase
performance if you fetch a lot of data.

SYNONYMCOLUMNS When this value is true (1), an 1


SQLColumn( ) API call returns column
information. Otherwise, SQLColumn( )
returns only columns for tables and
views. The ODBC Driver for Oracle
provides faster access when this value is
not set.

REMARKS When this value is true (1), the driver 0


returns Remarks columns for the
SQLColumns result set. The ODBC
Driver for Oracle provides faster access
when this value is not set.

StdDayOfWeek Enforces the ODBC standard for the 1


DAYOFWEEK scalar. By default this is
turned on, but users who need the
localized version can change the
behavior to use whatever Oracle
returns.

GuessTheColDef Specifies whether or not the driver 0


should return a non-zero value for the
cbColDef argument of
SQLDescribeCol. Applies only to
columns where there is no Oracle-
defined scale, such as computed
numeric columns and columns defined
as NUMBER without a precision or
scale. A SQLDescribeCol call returns
130 for the precision when Oracle does
not provide that information.

For example, a connection string that connects to the MyDataSource data source using the MyOracleServerOracle
Server and the Oracle User MyUserID would be:

"DSN={MyDataSource};UID={MyUserID};PWD={MyPassword};SERVER={MyOracleServer}"

A connection string that connects to the MyOtherDataSource data source using operating system authentication
and the MyOtherOracleServerOracle Server would be:

"DSN=MyOtherDataSource;UID=/;PWD=;SERVER=MyOtherOracleServer"
Connect Options
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

These options allow customization of the database connection within an application.

CONNECT OPTION NOTES

SQL_AUTOCOMMIT If you choose SQL_AUTOCOMMIT_OFF, your application


must explicitly commit or roll back transactions with
SQLTransact.

SQL_ODBC_CURSORS This connection attribute is implemented in the Driver


Manager.

SQL_OPT_TRACE This connection attribute is implemented in the Driver


Manager.

SQL_OPT_TRACEFILE This connection attribute is implemented in the Driver


Manager.

SQL_TRANSLATE_DLL Returns error: "Driver not capable."

SQL_TRANSLATE_OPTION A 32-bit value passed to the translation .dll.

SQL_TXN_ISOLATION The driver allows only SQL_TXN_READ_COMMITTED.

The following vParams are not supported:

SQL_TXN_READ_UNCOMMITTED

SQL_TXN_REAPEATABLE_READ

SQL_TXN_SERIALIZABLE

SQL_ATTR_ENLIST_IN_DTC This ODBC 3.0 connection attribute allows you to use the
ODBC Driver for Oracle in distributed transactions
coordinated by Microsoft Component Services (or MTS, if you
are using Windows NT). It provides the interface pointer
pITransaction to the transaction as the vParam argument.

SQL_ATTR_CONNECTION_DEAD This read-only ODBC 3.5 connection attribute allows you to


determine whether the connection to the Oracle server has
failed. Get only; cannot Set.
Statement Options
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

These options allow customization of a specific execution statement within an application.

STATEMENT OPTION NOTES

SQL_BIND_TYPE Cannot exceed 2,147,483,647 bytes or available memory.

SQL_CONCURRENCY For allowed values, see the Cursor Type and Concurrency
Combinations.

SQL_CURSOR_TYPE The driver does not allow SQL_CURSOR_DYNAMIC. See


SQLSetScrollOptions for more information. For allowed values,
see the Cursor Type and Concurrency Combinations.

SQL_GET_BOOKMARK Returns a 32-bit integer value that is the bookmark for the
current record number. Get only; cannot Set.

SQL_KEYSET_SIZE Can be set only to 0.

SQL_MAX_ROWS The maximum number of rows to return from a result set.

SQL_ROW_NUMBER Returns a 32-bit integer specifying the position of the current


row within the result set. Get only; cannot Set.

SQL_ROWSET_SIZE Cannot exceed 4,294,967,296 rows; however, you must have


enough virtual memory in your computer to handle your
request.

SQL_USE_BOOKMARKS Supports setting SQL_USE_BOOKMARKS to SQL_UB_ON and


exposes fixed-length bookmarks.
Cursor Type and Concurrency Combinations
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Cursor types control the functionality of the cursor provided to the user. Concurrency options control the
updatability and locking behavior of a result set.

CURSOR TYPE CONCURRENCY (ALLOWED VALUES)

SQL_CURSOR_FORWARD_ONLY SQL_CONCUR_READ_ONLY

SQL_CURSOR_STATIC SQL_CONCUR_READ_ONLY

SQL_CURSOR_KEYSET_DRIVEN[1] SQL_CONCUR_READ_ONLY SQL_CONCUR_LOCK[2]


SQL_CONCUR_VALUES

[1] See Limitations of Using Keyset-Driven Cursors.


[2]
SQL_CONCUR_LOCK is supported only when the SQL_AUTOCOMMIT connection option is set to
SQL_AUTOCOMMIT_OFF.

See Also
Connect Options
Using Microsoft Component Services
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

You can enable an Oracle database to work with transactional Component Services (or MTS, if you are using
Windows NT) on Microsoft Windows NT/Windows 2000 and Microsoft Windows 95/98. To enable an Oracle
database to work with Component Services that support transactions, system administrators should create a view
named V$XATRANS$. To create this script, you must run an Oracle-supplied script. For more information, see the
Component Services Help or your Oracle documentation.
Using Microsoft Internet Information Services
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

If you have difficulty connecting from within an IIS script (particularly if you receive an ORA-12641 error), add the
following line to the Sqlnet.ora file:

SQLNET.AUTHENTICATION_SERVICES = (none)

This will disable the Secure Network Services so you can connect using anonymous authentication.
Using Operating System Authentication
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Oracle operating system authentication relies on the underlying operating system to control access to database
accounts. Users need not enter a password when using this type of login.
To take advantage of this feature, specify "/" as the user ID and do not specify a password when connecting using
any of the following connection APIs: SQLBrowseConnect, SQLConnect, or SQLDriverConnect.
Oracle databases use SQL*Net Authentication Services to authenticate users that are logged on. This service
works well if users are logged into Oracle through SQLPlus; however, when the logged-in user is a service such as
Internet Information Services, the authentication fails. This is a known limitation of SQL*Net Authentication and
produces the following error: "[Microsoft][ODBC driver for Oracle][Oracle]ORA-12641: TNS:authentication
service failed to initialize."
You can correct this problem by editing the Sqlnet.ora file. This configuration file is usually stored in the
Network\Admin subdirectory of the Oracle home directory. Add the following line to Sqlnet.ora:

SQLNET.AUTHENTICATION_SERVICES = (none)
Using SQLConfigDatasource with the ODBC Driver
for Oracle
4/10/2018 • 2 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The following table lists valid SQLConfigDatasource settings for the Microsoft ODBC Driver for Oracle, version
1.0 (Msorcl10.dll) and the Microsoft ODBC Driver for Oracle, version 2.0 (Msorcl32.dll).

NOTE
The Msorcl10.dll driver (version 1.0) supports all settings except Server. The Msorcl32.dll driver (version 2.0 and higher)
supports all settings.

Some settings are ignored by the driver but are accepted by SQLConfigDatasource. Including these settings in
the ODBC connection string is the only way they will be accepted at run time. An ignored setting will not be stored
in the registry when SQLConfigDatasource creates the data source.
In the following table, A/N means any valid alphanumeric string up to the maximum allowable length. Max Len
(maximum length) is the maximum allowable string length accepted by the setting, including the string-terminator
character.

SETTING MAX LEN DEFAULT VALUE VALID VALUES DESCRIPTION

BufferSize 7 65535 1000 Minimum fetch buffer


size up to 65535
bytes

CatalogCap 2 1 0 or 1 If 1, nonquoted
identifiers will be
converted to
uppercase in the
catalog functions.

ConnectString 128 "" A/N Connection string.


Required method of
specifying the server
name with the
Msorcl10.dll driver.

Description 256 "" A/N Description.

DSN 33 "" A/N Data source name.


SETTING MAX LEN DEFAULT VALUE VALID VALUES DESCRIPTION

GuessTheColDef 4 0 A/N Returns a non-zero


value for columns
without Oracle-
defined scale.

NumberFloat 2 "" 0 or 1 If 0, FLOAT columns


are treated as
SQL_FLOAT. If 1,
FLOAT columns are
treated as
SQL_DOUBLE.

PWD 30 "" A/N Password.

RDOSupport 2 "" 0 or 1 Allows RDO to call


Oracle procedures.

Remarks 2 0 0 or 1 Include REMARKS in


catalog functions.

RowLimit 4 "" 0 to 99 Maximum number of


rows returned by a
SELECT statement. A
zero-length string
indicates that no limit
is applied.

Server 128 "" A/N Oracle server name.

SynonymColumns 2 1 0 or 1 Include SYNONYMs in


SQLColumns.

SystemTable 2 "" 0 or 1 If 0, system tables will


not be displayed. If 1,
system tables will be
displayed.

TranslationDLL 33 "" A/N Translation .dll name.

TranslationName 33 "" A/N Translation name.

TranslationOption 33 "" A/N Translation option.

TxnCap 2 "" A/N Transaction capable. If


0, the driver reports
that it does not
support transactions.
If 1, the driver reports
that it is capable of
performing
transactions.

UID 30 "" A/N User name.


Limitations of Using Keyset-Driven Cursors
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

You must be able to retrieve a single ROWID column for the table queried. A keyset-driven cursor cannot be used
on joins, queries, or statements that contain DISTINCT, GROUP BY, UNION, INTERSECT, or MINUS clauses.
Also, if your application uses table aliases, keyset-driven cursors will not work; forward-only or static cursor types
are required. Using the keyset cursor type with table aliases will cause the following error: "[Microsoft][ODBC
driver for Oracle]Cannot use Keyset-driven cursor on join, with union, intersect or minus or on read only result
set."

NOTE
Because of the way the driver handles the SQL statement that is sent to the Oracle server, Oracle internally returns the
following error message: "ORA-00964: table name not in FROM list."
Stored Procedures (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

This section includes the following topics:


Stored Procedure Parameter Limitations
Using Synonyms with Stored Procedures
Revoking and Granting Rights When Using Stored Procedures
Returning Array Parameters from Stored Procedures
Stored Procedure Parameter Limitations
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

When running Oracle stored procedures that utilize 10 or more output parameters, the stored procedure call will
fail, resulting in an Access Violation or ActiveX Data Objects (ADO ) error. This can occur when using the Microsoft
ODBC Driver for Oracle with versions 8.0.4.0.0 and 8.0.4.0.4 of the Oracle client software.
To correct the problem, the Oracle client software must be upgraded to version 8.0.4.2.0 or higher. Contact Oracle
Corporation for more information about the patches.

NOTE
This problem does not occur with the early release of Oracle client software version 8.0.3.0.0.
Using Synonyms with Stored Procedures
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The Microsoft ODBC Driver for Oracle versions 2.0 and 2.5 do not support synonyms when calling Oracle stored
procedures. Synonyms work as expected when used with other Oracle database objects such as tables.
Revoking and Granting Rights When Using Stored
Procedures
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The Microsoft ODBC Driver for Oracle returns the following error message when user rights are granted and then
revoked on a table accessed by a stored procedure:
SQL_ERROR=-1
szErrorMsg="[Microsoft][ODBC driver for Oracle]Wrong number of parameters"
szErrorMsg="[Microsoft][ODBC driver for Oracle]Syntax error or access violation"
The call to the Oracle OCI function Odessp() fails in this scenario but is necessary in order to implement default
parameters. After the underlying table permissions are modified, the stored procedure must be recompiled before
running it again.
Returning Array Parameters from Stored Procedures
12/20/2017 • 2 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

In Oracle 7.3, there is no way to access a PL/SQL Record Type except from a PL/SQL program. If a packaged
procedure or function has a formal argument defined as a PL/SQL Record Type, it is not possible to bind that
formal argument as a parameter. Use the PL/SQL TABLE type in the Microsoft ODBC Driver for Oracle to invoke
array parameters from procedures containing the correct escape sequences.
To invoke the procedure, use the following syntax:

{call <package-name>.<proc-or-func>;
(..., {resultset <max-records-requested> ,<formal-array-param_1>,;
<formal-array-param_2>,...,<formal-array-param_n> }, ... ) }

NOTE
The <max-records-requested> parameter must be greater than or equal to the number of rows present in the result set.
Otherwise, Oracle returns an error that is passed to the user by the driver.
PL/SQL records cannot be used as array parameters. Each array parameter can represent only one column of a database
table.

The following example defines a package containing two procedures that return different result sets, and then
provides two ways to return result sets from the package.

Package definition:
CREATE OR REPLACE PACKAGE SimplePackage AS

TYPE t_id is TABLE of NUMBER(5)


INDEX BY BINARY_INTEGER;

TYPE t_Course is TABLE of VARCHAR2(10)


INDEX BY BINARY_INTEGER;

TYPE t_Dept is TABLE of VARCHAR2(5)


INDEX BY BINARY_INTEGER;

PROCEDURE proc1
(
o_id OUT t_id,
ao_course OUT t_Course,
ao_dept OUT t_Dept
);

TYPE t_pk1Type1 IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER;


TYPE t_pk1Type2 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
PROCEDURE proc2
(
i_Arg1 IN NUMBER,
ao_Arg2 OUT t_pk1Type1,
ao_Arg3 OUT t_pk1Type2
);

END SimplePackage;

CREATE OR REPLACE PACKAGE BODY SimplePackage AS


PROCEDURE proc1 ( o_id OUT t_id,
ao_course OUT t_Course, ao_dept OUT t_Dept ) AS
BEGIN
o_id(1):= 200;
ao_course(1) := 'M101';
ao_dept(1) := 'EEE' ;

o_id(2) := 201;
ao_course(2) := 'PHY320';
ao_dept(2) := 'ECE' ;

END proc1;
PROCEDURE proc2
(
i_Arg1 IN NUMBER,
ao_Arg2 OUT t_pk1Type1,
ao_Arg3 OUT t_pk1Type2
)
AS
i NUMBER;
BEGIN
FOR i IN 1 .. i_Arg1 LOOP
ao_Arg2(i) := 'Row Number ' || to_char(i);
END LOOP;
FOR i IN 1 .. i_Arg1 LOOP
ao_Arg3(i) := i;
END LOOP;
END proc2;
END SimplePackage;

To invoke procedure PROC1


1. Return all the columns in a single result set:

{call SimplePackage.Proc1( {resultset 3, o_id , ao_course, ao_dept } ) }


2. Return each column as a single result set:

{call SimplePackage.Proc1( {resultset 3, o_id}, {resultset 3, ao_course}, {resultset 3, ao_dept} ) }

This returns three result sets, one for each column.


To invoke procedure PROC2
1. Return all the columns in a single result set:

{call SimplePackage.Proc2( 5 , {resultset 5, ao_Arg2, ao_Arg3} ) }

2. Return each column as a single result set:

{call SimplePackage.Proc2( 5 , {resultset 5, ao_Arg2}, {resultset 5, ao_Arg3} ) }

Ensure that your applications fetch all the result sets using the SQLMoreResults API. For more information,
refer to the ODBC Programmer's Reference.

NOTE
In the ODBC Driver for Oracle version 2.0, Oracle functions that return PL/SQL arrays cannot be used to return result sets.
Error Messages (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

When an error occurs, the Microsoft ODBC Driver for Oracle returns the SQLSTATE (an ODBC error code) and an
error message. The driver derives this information both from errors detected by the driver and from errors
returned by the Oracle Server.
This section includes the following topic:
Messages Returned by the ODBC Driver for Oracle
Messages Returned by the ODBC Driver for Oracle
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

If an Oracle error message is available, it will be returned preceded by the [Microsoft], [ODBC Driver for Oracle],
and [Oracle] tags; otherwise, the message is returned without the [Oracle] tag as in the following examples:

Oracle error message:


[Microsoft][ODBC driver for Oracle][Oracle]ORA-nnnnn message-text

ODBC Driver for Oracle error message:


[Microsoft][ODBC driver for Oracle]
ODBC Driver for Oracle Conformance Levels
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

ODBC defines two types of conformance standards for drivers: the API conformance standard and the SQL
grammar conformance standard. API conformance refers to the functions that a driver supports. SQL
conformance refers to the SQL grammar that the driver supports. Each conformance standard is made up of
levels.
This section provides conformance information about the ODBC Driver for Oracle.
This section contains the following topics.
API Conformance Level (ODCB Driver for Oracle)
Supported Options (ODCB Driver for Oracle)
SQL Conformance Levels (ODCB Driver for Oracle)
API Conformance Level (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The ODBC Driver for Oracle supports the Core Level API functions and Level 1 API functions. The driver also
supports the following Level 2 API functions:
SQLBrowseConnect( )
SQLDataSources( )
SQLDescribeParam( )
SQLExtendedFetch( )
SQLForeignKeys( )
SQLMoreResults( )
SQLNativeSql( )
SQLNumParams( )
SQLPrimaryKeys( )
SQLProcedureColumns( )
SQLProcedures( )
SQLSetPos( )
SQLSetScrollOptions( )
Supported Options (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The ODBC Driver for Oracle supports the following options for the SQLGetConnectOption( ) and
SQLSetConnectOption( ) Level 1 functions:
SQL_ACCESS_MODE (SQLGetConnectOption( ) only)
SQL_AUTOCOMMIT
SQL_ODBC_CURSORS
SQL_OPT_TRACEFILE
SQL_OPT_TRACE
SQL_TRANSL ATE_DLL
SQL_TRANSL ATE_OPTION
SQL_TXN_ISOL ATION
The ODBC Driver for Oracle supports the following options for the SQLGetStmtOption( ) and
SQLSetStmtOption( ) Level 1 functions:
SQL_BIND_TYPE
SQL_CONCURRENCY
SQL_CURSOR_TYPE
SQL_KEYSET_SIZE
SQL_MAX_ROWS
SQL_ROWSET_SIZE
SQL Conformance Levels (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The ODBC Driver for Oracle supports the Minimum SQL grammar and Core SQL grammar and also supports the
following ODBC extensions to SQL:
Date, time, and timestamp data
Left and right outer joins
Numeric functions:

Abs Log round tan

Ceiling Log10 second truncate

Cos Mod sign

Exp Pi sin

Floor Power sqrt

Date functions:

Curdate Dayofweek monthname second

Curtime Dayofyear minute week

Dayname Hour now year

Dayofmonth Month quarter

String functions:

Ascii Left right ucase

Char Length rtrim

Concat Ltrim soundex

Lcase Replace substring


Type-conversion function:
||
|-|
|Convert|
System functions:
||
|-|
|Ifnull|
|User|
API Functions (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The Microsoft ODBC Driver for Oracle supports the Core Level, Level 1, and Level 2 API functions. These
functions are listed in ODBC Conformance Levels.
Core Level Interface (CLI) conformance provides features defined in the ISO CLI specification and the
mandatory features defined in the Open Group CLI specification.
Level 1 conformance provides Core Level Interface functionality as well as additional features such as
transactions.
Level 2 conformance provides Level 1 functionality as well as additional features such as bookmarks,
dynamic parameters, and asynchronous execution of ODBC functions.
Thread-Safety Notes on API Functions (ODBC Driver
for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The Microsoft ODBC Driver for Oracle is thread-safe; however, Oracle does not allow multiple concurrent
statements on a single connection. The driver enforces this restriction. In other words, in multithreaded
applications, although any thread can call into the ODBC Driver for Oracle at any time, the driver blocks any other
thread from the driver on the same connection until the original thread leaves the driver.
The driver does not block if there are two statements on two different connections. However, if there is a single
connection with two statements, there is potential for blocking.
Core Level API Functions (ODBC Driver for Oracle)
12/20/2017 • 4 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Functions at this level comprise the minimum level of interface conformance for ODBC drivers.

API FUNCTION NOTES

SQLAllocConnect Allocates memory for a connection handle, hdbc, within the


environment identified by henv. The Driver Manager
processes this call and calls the driver's SQLAllocConnect
function whenever SQLConnect, SQLBrowseConnect, or
SQLDriverConnect is called.

SQLAllocEnv Displays a dialog box specifying the requirement for Oracle


Client software and then returns SQL_NULL_HANDLE. If the
Oracle Client software is not installed, this function allocates
memory for an environment handle, henv,and initializes the
ODBC call-level interface for use by an application.

SQLAllocStmt Allocates memory for a statement handle and associates the


statement handle with the connection specified by hdbc. The
Driver Manager passes this call to the driver, which allocates
the memory for the hstmt structure.

SQLBindCol Assigns storage space for a result column and specifies the
type of the result.

SQLCancel Cancels the processing on a statement handle, hstmt. In some


cases, Oracle does not allow cancellation of a running
statement. This means that a running statement will continue
until Oracle completes the process, at which time the results
from the statements are canceled by the ODBC Driver for
Oracle.

SQLColAttributes Returns descriptor information for a column in a result set.


Descriptor information is returned as a character string, a 32-
bit descriptor-dependent value, or an integer value.

SQLConnect Connects to a data source. To use Oracle Operating System


Authentication, specify "/" as the szUID parameter and "" as
the szAuthStr parameter.

SQLDescribeCol Returns the name, type, precision, scale, and nullability of the
given result column. Note: SQLDescribeCol reports
calculated columns as SQL_VARCHAR.
API FUNCTION NOTES

SQLDisconnect Closes a connection. If connection pooling is enabled for a


shared environment and an application calls SQLDisconnect
on a connection in that environment, the connection is
returned to the connection pool and is still available to other
components using the same shared environment.

SQLError Returns error or status information about the last error. The
driver maintains a stack or list of errors that can be returned
for the hstmt, hdbc, and henv arguments, depending on how
the call to SQLError is made. The error queue is flushed after
each statement. Usually retrieves an Oracle error message
and is otherwise empty.

SQLExecDirect Executes a new, unprepared SQL statement. The driver uses


the current values of the parameter marker variables if any
parameters exist in the statement. If your table, view, or field
names contain spaces, enclose the names in back quote
marks. For example, if your database contains a table named
My Table and the field My Field, enclose each element of the
identifier like so:

SELECT `My Table`. `My Field1`,; `My Table`.`My Field2` FROM


`My Table`

SQLExecute Executes a prepared SQL statement (a statement already


prepared by SQLPrepare). The driver uses the current values
of the parameter marker variables if any parameters exist in
the statement.

SQLFetch Retrieves one row from a result set into the locations specified
by the previous calls to SQLBindCol. Prepares the driver for a
call to SQLGetData for the unbound columns.

SQLFreeConnect Releases a connection handle and frees all memory allocated


for the handle.

SQLFreeEnv Closes the ODBC Driver for Oracle and releases all memory
associated with the driver.

SQLFreeStmt Stops processing associated with a specific hstmt, closes any


open cursors associated with the hstmt, discards pending
results, and optionally frees all resources associated with the
statement handle.

SQLGetCursorName Returns the name of the cursor associated with the given
hstmt.

SQLNumResultCols Returns the number of columns in a result set cursor.


API FUNCTION NOTES

SQLPrepare Prepares an SQL statement by planning how to optimize and


execute the statement. The SQL statement is compiled for
execution by SQLExecDirect.

If your table, view, or field names contain spaces, enclose the


names in back quote marks. For example, if your database
contains a table named My Table and the field My Field,
enclose each element of the identifier as follows:

SELECT `My Table`.`My Field` FROM `My Table`

For information about using result sets containing arrays as


formal parameters, see Returning Array Parameters from
Stored Procedures.

SQLRowCount Oracle does not provide a way to determine the number of


rows in a result set until after you fetch the last row, so it
returns –1.

SQLSetCursorName Associates a cursor name with an active statement handle,


hstmt.

SQLSetParam Replaced by SQLBindParameter in ODBC 2.x.

SQLTransact Requests a commit or rollback operation for all active


operations on all statement handles (hstmts) associated with
a connection, or for all connections associated with the
environment handle, henv. If a commit fails when in manual
mode, the transaction remains active; you can choose to roll
back the transaction or retry the commit operation. If a
commit operation fails when in automatic transaction mode,
the transaction is rolled back automatically; the transaction
cannot be inactive.
Level 1 API Functions (ODBC Driver for Oracle)
12/20/2017 • 2 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Functions at this level provide Core interface conformance plus additional functionality such as transaction
support.

API FUNCTION NOTES

SQLColumns Creates a result set for a table, which is the column list for the
specified table or tables. When you request columns for a
PUBLIC synonym, you must have set the
SYNONYMCOLUMNS connection attribute and specified an
empty string as the szTableOwner argument. When returning
columns for PUBLIC synonyms, the driver sets the TABLE
NAME column to an empty string. The result set contains an
additional column, ORDINAL POSITION, at the end of each
row. This value is the ordinal position of the column in the
table.

SQLDriverConnect Connects to an existing data source. For details, see


Connection String Format and Attributes.

SQLGetConnectOption Returns the current setting of a connection option. This


function is partially supported. The driver supports all values
for the fOption argument but does not support some
vParam values for the fOption argument
SQL_TXN_ISOLATION. For more information, see Connect
Options.

SQLGetData Retrieves the value of a single field in the current record of the
given result set.

SQLGetFunctions Returns TRUE for all supported functions. Implemented by the


Driver Manager.

SQLGetInfo Returns information, including SQLHDBC, SQLUSMALLINT,


SQLPOINTER, SQLSMALLINT, and SQLSMALLINT *, about the
ODBC Driver for Oracle and data source associated with a
connection handle, hdbc.

SQLGetStmtOption Returns the current setting of a statement option. For more


information, see Statement Options.

SQLGetTypeInfo Returns information about the data types supported by a


data source. The driver returns the information in an SQL
result set.
API FUNCTION NOTES

SQLParamData Used in conjunction with SQLPutData to specify parameter


data at statement execution time.

SQLPutData Allows an application to send data for a parameter or column


to the driver at statement execution time.

SQLSetConnectOption Provides access to options that govern aspects of the


connection. This function is partially supported: The driver
supports all values for the fOption argument but does not
support some vParam values for the fOption argument
SQL_TXN_ISOLATION. For more information, see Connect
Options.

SQLSetStmtOption Sets options related to a statement handle, hstmt. For more


information, see Statement Options.

SQLSpecialColumns Retrieves the optimal set of columns that uniquely identifies a


row in the table.

SQLStatistics Retrieves a list of statistics about a single table and the


indexes, or tag names, associated with the table. The driver
returns the information as a result set.

SQLTables Returns the list of table names specified by the parameter in


the SQLTables statement. If no parameter is specified,
returns the table names stored in the current data source.
The driver returns the information as a result set.

Enumeration type calls will not receive a result set entry for
remote views or local parameterized views. However, a call to
SQLTables with a unique table name specifier will find a
match for such a view, if present, with that name; this allows
the API to check for name conflicts prior to creation of a new
table.

PUBLIC synonyms are returned with a TABLE_OWNER value


of "".

VIEWS owned by SYS or SYSTEM are identified as SYSTEM


VIEW.
Level 2 API Functions (ODBC Driver for Oracle)
12/20/2017 • 2 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and
plan to modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

Functions at this level provide Level 1 interface conformance plus additional functionality such as support for
bookmarks, dynamic parameters, and asynchronous execution of ODBC functions.

API FUNCTION NOTES

SQLBindParameter Associates a buffer with a parameter marker in an SQL


statement.

SQLBrowseConnect Returns successive levels of attributes and attribute values.

SQLDataSources Lists data source names. Implemented by the Driver


Manager.

SQLDescribeParam Returns the description of a parameter marker associated


with a prepared SQL statement.

Returns a best guess of what the parameter is, based on


parsing the statement. If the parameter type cannot be
determined, SQL_VARCHAR returns with length 2000.

SQLDrivers Implemented by the Driver Manager.

SQLExtendedFetch Similar to SQLFetch but returns multiple rows using an


array for each column. The result set is forward-scrollable
and can be made backward-scrollable if the cursor is defined
to be static, not forward-only. For forward-only cursors with
default column binding, column data from data sets larger
than the BUFFERSIZE connection attribute is fetched directly
into data buffers. Does not support variable-length
bookmarks and does not support fetching a rowset at an
offset (other than 0) from a bookmark.

SQLForeignKeys Returns a list of foreign keys in a single table, or a list of


foreign keys in other tables that refer to a single table.

SQLMoreResults Determines whether more results are pending on a


statement handle, hstmt, containing SELECT, UPDATE,
INSERT, or DELETE statements and if so, initializes
processing for those results.

Oracle supports multiple result sets only from stored


procedures, when using {resultset... } escape sequences.
API FUNCTION NOTES

SQLNativeSql For information about usage, see Returning Array


Parameters from Stored Procedures.

SQLNumParams Returns the number of parameters in an SQL statement.


The number of parameters should equal the number of
question marks in the SQL statement passed to
SQLPrepare.

SQLPrimaryKeys Returns the column names that comprise the primary key
for a table.

SQLProcedureColumns Returns a list of input and output parameters, the return


value, the columns in the result set of a single procedure,
and two additional columns, OVERLOAD and
ORDINAL_POSITION. OVERLOAD is the OVERLOAD column
from the ALL_ARGUMENTS table of the Oracle Data
Dictionary View. ORDINAL_POSITION is the SEQUENCE
column from the ALL_ARGUMENTS table of the Oracle Data
Dictionary View. For packaged procedures, the PROCEDURE
NAME column is in packagename.procedurename format.
Does not return the procedure columns of a created
synonym that refers to a procedure or function.

SQLProcedures Returns a list of procedures in the data source. For


packaged procedures, the PROCEDURE NAME column is in
packagename.procedurename format.

Because Oracle does not provide a way to distinguish


packaged procedures from packaged functions, the driver
returns SQL_PT_UNKNOWN for the PROCEDURE_TYPE
column.

SQLSetPos Sets the cursor position in a rowset. You can use


SQLSetPos with SQLGetData to retrieve rows from
unbound columns after positioning the cursor to a specific
row in the rowset. Rows added to the result set using
fOption SQL_ADD are added after the last row in the result
set.

SQLSetScrollOptions Sets options that control the behavior of cursors associated


with a statement handle, hstmt. For details, see Cursor Type
and Concurrency Combinations.
Supported Data Types (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The ODBC Driver for Oracle supports all Oracle 7.3 data types; however, it does not support any of the new
Oracle8 data types listed here.

DATA TYPE ORACLE 7.3 ORACLE8

BFILE n/a Not supported

BLOB n/a Not supported

CHAR Supported Supported

CLOB n/a Not supported

DATE Supported Supported

FLOAT Supported Supported

INTEGER Supported Supported

LONG Supported Supported

LONG RAW Supported Supported

NCHAR n/a Not supported

NCLOB n/a Not supported

NUMBER Supported Supported

NVARCHAR2 n/a Not supported

RAW Supported Supported

VARCHAR2 Supported Supported

MLSLABEL Not supported. Not supported.

NOTE
For more information about the allowable size of the VARCHAR column, see VARCHAR Column Size in this guide.
Mapping Data Types (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

The Oracle Server supports a set of data types. The ODBC Driver for Oracle maps these data types to their
appropriate ODBC SQL data types. The following table lists the Oracle 7.3 Server data types and their
corresponding ODBC SQL data types.
The ODBC Driver for Oracle supports Oracle 7.3 and some Oracle8 data types. For more information about
supported Oracle8 data types, see Supported Data Types.

ORACLE SERVER DATA TYPE ODBC SQL DATA TYPE

CHAR SQL_CHAR

DATE SQL_TIMESTAMP

FLOAT SQL_DOUBLE

INTEGER SQL_DECIMAL

LONG SQL_LONGVARCHAR

LONG RAW SQL_LONGVARBINARY

NUMBER SQL_DECIMAL

RAW SQL_VARBINARY

VARCHAR2 SQL_VARCHAR

NOTE
For more information about the allowable size of the VARCHAR column, see VARCHAR Column Size in this guide.
VARCHAR Column Size (ODBC Driver for Oracle)
12/20/2017 • 1 min to read • Edit Online

IMPORTANT
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to
modify applications that currently use this feature. Instead, use the ODBC driver provided by Oracle.

In Oracle8, the maximum size of a VARCHAR column has increased from 2000 to 4000 bytes. The Oracle 7.3.x
client software has no way to bind a parameter value larger than 2000 bytes. Therefore, if you create a table with a
VARCHAR column of larger than 2000 bytes, you will be unable to perform parameterized inserts, updates,
deletes, and queries against it with data that exceeds the 2000-byte limit of the client software. Because both the
ODBC Driver for Oracle and the OLE DB Provider for Oracle use parameterized inserts, updates, deletes, and
queries, they will report ORA-01026 errors in this case. Data that is within the limits enforced by the Oracle client
software will work. To avoid this 2000-byte limit, you must upgrade your client software to Oracle8 (8.0.4.1.1c or
higher).
Visual FoxPro ODBC Driver
12/20/2017 • 1 min to read • Edit Online

Microsoft Visual FoxPro is a powerful object-oriented environment for database construction and application
development. The Microsoft Visual FoxPro ODBC Driver enables applications to open, query, and update data in
Visual FoxPro and earlier versions of FoxPro through the Open Database Connectivity (ODBC ) interface.
For example, with the Microsoft Visual FoxPro ODBC Driver you can do the following:
Use Microsoft Query to query and update Visual FoxPro data from Microsoft Excel worksheets.
Create mail-merge letters using Visual FoxPro data with Microsoft Word.
Query and update Visual FoxPro views and tables from Microsoft Access.
Use Visual FoxPro as the data store for Microsoft Visual Basic, Microsoft Visual C++, and C applications.
You can use the driver to accomplish many other tasks. The following table lists a few topics to help you get
started.

TO SEE

Find out more about using Visual FoxPro data with Microsoft Accessing Visual FoxPro Data from Microsoft Office
Office

Learn about using Visual FoxPro data in Visual Basic Using the Visual FoxPro ODBC Driver with Your Visual Basic
applications Application

View a simple example using Visual C++ to access Visual Using the Visual FoxPro ODBC Driver with Your C or C++
FoxPro data Application

See a list of supported hardware and software System Requirements

For information about downloading and installing the Visual FoxPro ODBC driver, see Visual FoxPro ODBC Driver
on MSDN Downloads.
Driver Architecture Overview
12/20/2017 • 1 min to read • Edit Online

The Microsoft Visual FoxPro ODBC Driver is a 32-bit driver that enables you to open and query a Microsoft Visual
FoxPro database or FoxPro tables through the Open Database Connectivity (ODBC ) interface. You can access
FoxPro data using the following types of applications:
A Microsoft Office application, such as Microsoft Excel or Microsoft Word, that uses Microsoft Query to
communicate with ODBC.
An application written in Microsoft Visual C++ or C that uses the ODBC SDK API.
An application written in Microsoft Visual Basic or Microsoft Visual Basic for Applications.
In each case, the request for information uses the ODBC API. The ODBC Driver Manager works with the
Visual FoxPro ODBC Driver to open and retrieve data from FoxPro tables and databases.
The architecture is represented in the following diagram:

This section contains the following topics.


Visual FoxPro Terminology
Installing and Configuring the Visual FoxPro ODBC Driver
Using the Visual FoxPro ODBC Driver
Visual FoxPro Terminology
12/20/2017 • 1 min to read • Edit Online

database
In Visual FoxPro, a database file has a .dbc extension and can contain one or more tables.
database table
In Visual FoxPro, a table that is associated with a database. Contrast free table.
free table
In Visual FoxPro, a table that is not associated with a database.
A .dbf file created in FoxPro version 2.x is a free table unless it is converted to a Visual FoxPro table and added
to a Visual FoxPro database. Contrast database table.
preparable SQL statement
A SQL statement that has not already been processed by the SQLPrepare function. For more information
about this function with the Visual FoxPro ODBC Driver, see SQLPrepare (Visual FoxPro ODBC Driver).
table
In Visual FoxPro, records are stored in a table. Each row of a table represents a record, and the columns of the
table represent the fields of the record. Each Visual FoxPro table is stored in its own file with a .dbf extension.
Visual FoxPro tables can be associated with a database.
FoxPro version 2.x tables are not associated with a database.
Installing and Configuring
12/20/2017 • 1 min to read • Edit Online

To download the Visual FoxPro ODBC Driver, see the Visual FoxPro ODBC Driver download site.
This section contains the following topics to help you install and configure the Microsoft Visual FoxPro ODBC
Driver:
System Requirements
Supported Versions of FoxPro
Setting Up the Visual FoxPro ODBC Driver
ODBC Visual FoxPro Setup Dialog Box
To download the driver, see the Visual FoxPro ODBC Driver download site.
System Requirements (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The system requirements for installation provide the minimum operating system and disk space needed to
successfully install the driver. After you've installed the driver, you can select the specific application software you
want to use to access Visual FoxPro data.

Installation Requirements
For installation requirements and other information, see the Visual FoxPro ODBC Driver download site.

Accessing Visual FoxPro Data


To access Microsoft Visual FoxPro or FoxPro 2.x data, you must have the following:
ODBC Client Software (automatically installed with the driver)
Microsoft Visual FoxPro ODBC Driver
Any of the following types of application software:
Microsoft Office application such as Microsoft Excel or Microsoft Word
C or C++ language ODBC application
Microsoft Visual Basic ODBC application
Any of the following types of data:
Visual FoxPro database or a directory of free tables
FoxPro 2.0, 2.5, 2.6 table
The Visual FoxPro ODBC Driver supports double-byte character sets (DBCS ). For more information, see
International Support.
The driver does not support 16-bit Microsoft Windows 3.1 applications.
Supported Versions of FoxPro
12/20/2017 • 1 min to read • Edit Online

You can use the Microsoft® Visual FoxPro® ODBC Driver to access data stored in FoxPro tables. The following
versions of FoxPro data are supported:
2.0
2.5
2.6
Visual FoxPro (all versions)
When you access data stored in Visual FoxPro, you can choose to connect to a database that contains zero
or more tables or to a directory of free tables.
For more information about how to connect to a data source, see Adding a Visual FoxPro Data Source.
To download the driver, see the Visual FoxPro ODBC Driver download site.
Setting Up the Visual FoxPro ODBC Driver
12/20/2017 • 1 min to read • Edit Online

For information about downloading and installing the Visual FoxPro ODBC driver, see Visual FoxPro ODBC Driver
on MSDN Downloads.
You use the Microsoft Visual FoxPro ODBC Driver Setup program to do the following:
Add new components.
Remove installed components.
Reinstall to restore missing files and settings.
Remove all previously installed components.
After you install the driver on your system, the Setup program recognizes the installed driver components
and presents additional dialog boxes that enable you to change your driver's configuration.
ODBC Visual FoxPro Setup Dialog Box
12/20/2017 • 2 min to read • Edit Online

The ODBC Visual FoxPro Setup dialog box enables you to add or change a Visual FoxPro data source.
To download the driver, see the Visual FoxPro ODBC Driver download site.

Dialog Box Options


Data Source Name
Type the name you want to use for the data source.
Description
Type a description for the data source.
Database type
Lets you choose the type of database you want your data source to connect to.
Visual FoxPro database (.DBC )
Specifies that the data source connects to a Visual FoxPro database (.dbc file) and to all the tables and local views
in the database.
Free Table directory
Specifies that the data source connects to a directory of free tables. Any database tables in the same directory are
ignored by ODBC catalog functions such as SQLColumns or SQLTables. Database tables can be accessed by
using SQL SELECT statements sent through SQLExecute and SQLExecDirect.
Path
Displays the path and name for the database or the directory of free tables to which the data source connects.
Browse
Enables you to search your system and network for the database or directory to which you want to connect the
data source.
Options
Expands the dialog box so that you can set Visual FoxPro ODBC Driver options.

Driver
Collating sequence
The sequence in which fields are sorted. The default sequences reflect the sequences supported by your language
version of the operating system. For a list of supported collating sequences, see SET COLL ATE.
Exclusive
When this check box is selected, the driver opens the Visual FoxPro database exclusively when you access data
using the data source. Other users cannot access the database or the tables in the database while the database is
opened exclusively. Tables within the exclusively opened database are opened as SHARED. To open a table
exclusively, use the SET EXCLUSIVE command. This check box is disabled when Database type is set to Free
Table directory.
Null
Determines whether columns created with ALTER TABLE and CREATE TABLE allow null values. If you set Null
ON, INSERT – SQL inserts a null value into any column not included in an INSERT – SQL... VALUE clause. A
blank is inserted if Null is OFF. You can also control this option through a passed connection string as in the
following code:

strCon = "DRIVER=MICROSOFT VISUAL FOXPRO DRIVER;


SOURCETYPE=DBC;SOURCEDB=D:\Testdata.dbc;BACKGROUNDFETCH=NO;NULL=NO"

Deleted
Determines whether rows marked as deleted are returned. You can also control this option through a passed
connection string as in the following code:

strCon = "DRIVER=MICROSOFT VISUAL FOXPRO DRIVER;


SOURCETYPE=DBC;SOURCEDB=D:\Testdata.dbc;BACKGROUNDFETCH=NO;
DELETED=YES"

Fetch data in background


Determines whether records will be fetched in the background (progressive fetching) or your application will wait
until all records in the result set are fetched.
Using the Visual FoxPro ODBC Driver
12/20/2017 • 1 min to read • Edit Online

In this section, the following topics discuss how to use the Microsoft® Visual FoxPro® ODBC Driver:
Adding a Visual FoxPro Data Source
Modifying a Visual FoxPro Data Source
Deleting a Visual FoxPro Data Source
Connecting to a Visual FoxPro Data Source
Using Connection Strings
Using the Visual FoxPro ODBC Driver with Your Visual Basic Application
Using the Visual FoxPro ODBC Driver with Your C or C++ Application
Accessing Visual FoxPro Data from Microsoft Office
Adding a Visual FoxPro Data Source
12/20/2017 • 1 min to read • Edit Online

To access Visual FoxPro data from your application, you must have a data source. You can create a data source as
follows:
In an application, such as Microsoft® Word, Microsoft Excel, or Microsoft Access, that uses ODBC drivers.
Outside your application, using the Microsoft Windows® 95, Microsoft Windows 98, or Microsoft
Windows NT®/Windows 2000 Control Panel.
After a data source exists on your system, you can reuse the same data source every time that you want to
access Visual FoxPro data. If you have several different databases or tables you want to access, you can
create a separate data source for each database or directory.
The following procedure creates a data source by using Control Panel. For more information about how to
create a data source from an application, see Accessing Visual FoxPro Data from Microsoft Office.
To add a Visual FoxPro data source
1. On computers that are running Windows 2000, open the Windows Control panel and double-click
Administrative Tools.
2. Double-click Data Sources (ODBC ) to open the ODBC Data Source Administrator dialog box. This icon is
available after you have installed the Visual FoxPro ODBC Driver or any ODBC driver software.

NOTE
If you are running an earlier version of Windows, open the Windows Control panel and double-click 32-bit ODBC or
ODBC to open the ODBC Data Source Administrator dialog box.

3. Click Add.
4. In the Create New Data Source dialog box, select Microsoft Visual FoxPro Driver and then click Finish.
5. In the ODBC Visual FoxPro Setup dialog box, type the data source name and description, select the
database type, select the database or directory, and then click OK.
The new data source name is displayed in the User Data Sources list in the User DSN tab of the ODBC
Data Source Administrator dialog box.
6. Click OK to save the new data source and close the ODBC Data Source Administrator dialog box.
Modifying a Visual FoxPro Data Source
12/20/2017 • 1 min to read • Edit Online

To modify a Visual FoxPro data source


1. On computers running Windows 2000, open the Windows Control Panel and double-click Administrative
Tools.
2. Double-click Data Sources (ODBC ) to open the ODBC Data Source Administrator dialog box.This icon is
available after you've installed the Visual FoxPro ODBC Driver or any ODBC driver software.

NOTE
If you are running a previous version of Windows, open the Windows Control Panel and double-click 32-bit ODBC or
ODBC to open the ODBC Data Source Administrator dialog box.

3. In the User DSN or System DSN tab, select the name of the data source you want to modify and click
Configure.
4. In the ODBC Visual FoxPro Setup dialog box, select and change the items you want to modify and then click
OK.
5. Click OK to save changes and close the ODBC Data Source Administrator dialog box.
Your changes will take effect the next time you access the data source from your application.
Deleting a Visual FoxPro Data Source
12/20/2017 • 1 min to read • Edit Online

To delete a Visual FoxPro data source


1. On computers running Windows 2000, open the Windows Control Panel and double-click Administrative
Tools.
2. Double-click Data Sources (ODBC ) to open the ODBC Data Source Administrator dialog box. This icon is
available after you've installed the Visual FoxPro ODBC Driver or any ODBC driver software.

NOTE
If you are running a previous version of Windows, open the Windows Control Panel and double-click 32-bit ODBC or
ODBC to open the ODBC Data Source Administrator dialog box.

3. In the User DSN or System DSN tab, select the name of the data source you want to delete.
4. Click Remove.
5. Click OK to save changes and close the ODBC Data Source Administrator dialog box.
Connecting to a Visual FoxPro Data Source
12/20/2017 • 1 min to read • Edit Online

You can connect to a Visual FoxPro data source using your Microsoft Office application or using the SQL API.

TO CONNECT FROM SEE

Microsoft Access, Microsoft Excel, or Microsoft Word Accessing Visual FoxPro Data from Microsoft Office

Your C or C++ application SQLConnect

SQLDriverConnect

Your Visual Basic application Using the Visual FoxPro ODBC Driver with Your Visual Basic
Application
Using Connection Strings
12/20/2017 • 1 min to read • Edit Online

You can use a connection string to connect to a Visual FoxPro data source.
For example, to connect to the TasTrade data source and override the current setting of Exclusive associated with
the data source, you would use the string:

DSN=TasTrade;Exclusive=Yes

For a list of the attribute keywords and values you can include in the connection string, see SQLDriverConnect.
For a complete explanation of connection string syntax, see SQLBrowseConnect in the ODBC Programmer's
Reference.
Using the VFP FoxPro ODBC Driver with Your Visual
Basic Application
12/20/2017 • 1 min to read • Edit Online

Your Microsoft® Visual Basic® application can communicate with Visual FoxPro data by creating a data control
that connects to a Visual FoxPro data source.
To connect to Visual FoxPro data using the Data Control in Visual Basic
1. Create a data source named "test" that connects to the TasTrade sample database included in Visual FoxPro.
The default Visual FoxPro installation places the TasTrade sample database in the location:

c:\vfp\samples\mainsamp\data\tastrade.dbc

2. In Visual Basic, create a new form and place a text box and a Data control on it.
3. Change the Data control's Connect property as follows:

ODBC;DATABASE=tastrade;DSN=test

4. Change the RecordsetType property to the following:

2 - Snapshot

5. Change the RecordSource property to the following:

customer

6. Change the DataSource property for the text box to the default name for the Data control to the following:

data1

7. Change the text box's DataField property to the following:

customer_id

8. Run the form, and use the Data control to skip through the customer id fields from the Visual FoxPro
TasTrade sample database.
Use the Visual FoxPro ODBC Driver with Your C or
Visual C++ Application
12/20/2017 • 2 min to read • Edit Online

Your C or C++ application communicates with Visual FoxPro data by sending a SQLExecute or SQLExecDirect
statement to Visual FoxPro. This statement can contain the following:
SQL statements native to the Visual FoxPro language, such as the DROP TABLE command.
Supported ODBC SQL grammar.
Non-SQL Visual FoxPro language such as supported SET commands.
For more information about SQL native to Visual FoxPro, see the Visual FoxPro documentation.

Example: Using the Visual FoxPro ODBC Driver with Your C or C++
Application
The following example uses the ODBC C API to retrieve data stored in the last_name field in the employee table in
the Microsoft® Visual FoxPro sample database named TasTrade. This database is provided with Visual FoxPro and
is installed by default in the following location:
c:\vfp\samples\mainsamp\data\tastrade.dbc

The example displays one last name at a time, allowing you to click OK on the message box to see the next last
name. It is assumed that a data source named Tastrade has been set up to use the Tastrade.dbc database.

NOTE
Error checking should be performed on all ODBC API calls; this example excludes error checking for the sake of brevity.

// FoxPro_ODBC_Driver_with_C.cpp
// compile with: odbc32.lib user32.lib /c
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <stdio.h>
#include <mbstring.h>

#define MAX_DATA 100


#define MYSQLSUCCESS(rc) ((rc==SQL_SUCCESS)||(rc==SQL_SUCCESS_WITH_INFO))

class direxec {
RETCODE rc; // ODBC return code
HENV henv; // Environment
HDBC hdbc; // Connection handle
HSTMT hstmt; // Statement handle
unsigned char szData[MAX_DATA]; // Returned data storage
SDWORD cbData; // Output length of data
unsigned char chr_ds_name[SQL_MAX_DSN_LENGTH]; // Data source name

public:
direxec(); // Constructor
void sqlconn(); // Allocate env, stat, and conn
void sqlexec(unsigned char *); // Execute SQL statement
void sqldisconn(); // Free pointers to env, stat, conn, and disconnect
void sqldisconn(); // Free pointers to env, stat, conn, and disconnect
void error_out(); // Displays errors
};

// Constructor initializes the string chr_ds_name with the data source name.
direxec::direxec() {
_mbscpy_s(chr_ds_name, (const unsigned char *)"tastrade");
}

// Allocate environment handle, allocate connection handle,


// connect to data source, and allocate statement handle.
void direxec::sqlconn() {
SQLAllocEnv(&henv);
SQLAllocConnect(henv, &hdbc);
rc=SQLConnect(hdbc, chr_ds_name, SQL_NTS, NULL, 0, NULL, 0);

// Deallocate handles, display error message, and exit.


if (!MYSQLSUCCESS(rc)) {
SQLFreeEnv(henv);
SQLFreeConnect(hdbc);
error_out();
exit(-1);
}

rc = SQLAllocStmt(hdbc, &hstmt);
}

// Execute SQL command with SQLExecDirect() ODBC API.


void direxec::sqlexec(unsigned char * cmdstr) {
rc = SQLExecDirect(hstmt, cmdstr, SQL_NTS);
if (!MYSQLSUCCESS(rc)) { // Error
error_out();
// Deallocate handles and disconnect.
SQLFreeStmt(hstmt, SQL_DROP);
SQLDisconnect(hdbc);
SQLFreeConnect(hdbc);
SQLFreeEnv(henv);
exit(-1);
}
else {
for (rc = SQLFetch(hstmt) ; rc == SQL_SUCCESS; rc=SQLFetch(hstmt)) {
SQLGetData(hstmt, 1, SQL_C_CHAR, szData, sizeof(szData), &cbData);
// In this example, the data is returned in a messagebox for
// simplicity. However, normally the SQLBindCol() ODBC API could
// be called to bind individual data rows and assign for a rowset.
MessageBox(NULL, (const char *)szData, "ODBC", MB_OK);
}
}
}

// Free the statement handle, disconnect, free the connection handle, and
// free the environment handle.
void direxec::sqldisconn() {
SQLFreeStmt(hstmt, SQL_DROP);
SQLDisconnect(hdbc);
SQLFreeConnect(hdbc);
SQLFreeEnv(henv);
}

// Display error message in a message box that has an OK button.


void direxec::error_out() {
unsigned char szSQLSTATE[10];
SDWORD nErr;
unsigned char msg[SQL_MAX_MESSAGE_LENGTH + 1];
SWORD cbmsg;

while(SQLError(0, 0, hstmt, szSQLSTATE, &nErr, msg, sizeof(msg), &cbmsg) == SQL_SUCCESS) {


sprintf_s((char *)szData, MAX_DATA, "Error:\nSQLSTATE=%s, Native error=%ld, msg='%s'",
szSQLSTATE, nErr, msg);
MessageBox(NULL, (const char *)szData, "ODBC Error", MB_OK);
}
}

int main (){


// Declare an instance of the direxec object.
direxec x;

// Allocate handles and connect.


x.sqlconn();

// Execute SQL command "SELECT last_name FROM employee".


x.sqlexec((UCHAR FAR *)"SELECT last_name FROM employee");

// Free handles, and disconnect.


x.sqldisconn();

// Return success code; example executed successfully.


return (TRUE);
}
Accessing Visual FoxPro Data from Microsoft Office
12/20/2017 • 1 min to read • Edit Online

You can use the Microsoft Visual FoxPro ODBC Driver to access Visual FoxPro data from your Microsoft Office
for Windows 95 or Windows 98 applications.
This section contains the following topics.

TO SEE

Use Microsoft Access Querying and Updating Visual FoxPro Data from Access

Importing Visual FoxPro Data into Microsoft Access

Use Microsoft Excel Accessing a Visual FoxPro Data Source from Microsoft Excel

Importing Data into Microsoft Excel from a Visual FoxPro


Database

Use Microsoft Word Creating Mailing Labels in Microsoft Word Using Visual
FoxPro Data
Querying and Updating Visual FoxPro Data from
Microsoft Access
12/20/2017 • 1 min to read • Edit Online

You can query and update data stored in a Visual FoxPro database from a Microsoft Access database by using the
Link Table option.
To link a Visual FoxPro database to a Microsoft Access database
1. Open a Microsoft Access database.
2. From the Tables tab, click New.
3. In the New Table dialog box, select Link Table and click OK.
4. In the Link Dialog box, select ODBC Database in the Files of type list.
5. In the SQL Data Sources dialog box, select the data source that connects to the Visual FoxPro data you want
to query and click OK.
6. In the Link Tables dialog box, select the tables you want to query and update and click OK. The linked Visual
FoxPro tables are displayed in the Tables tab of the Microsoft Access database.
You can now use Microsoft Access to query and update data in the linked Visual FoxPro tables. Changes
you make to linked data are sent back to the Visual FoxPro data source.
If you do not want changes you make in Microsoft Access to affect the data on the Visual FoxPro data
source, see Importing Visual FoxPro Data into Microsoft Access.
Importing Visual FoxPro Data into Microsoft Access
12/20/2017 • 1 min to read • Edit Online

You can import data stored in a Visual FoxPro database into a Microsoft Access database using the Import option.
To import Visual FoxPro data into a Microsoft Access database
1. Open a Microsoft Access database.
2. From the File menu, choose Get External Data then Import.
3. In the Import dialog box, select ODBC Databases in the Files of type list.
4. In the SQL Data Sources dialog box, select the Visual FoxPro data source that connects to the FoxPro data
you want to query and click OK.
5. In the Import Objects dialog box, select one or more tables you want to import and click OK. The names of
the Visual FoxPro tables you imported are displayed in the Tables tab of the Microsoft Access database.
You can now use Microsoft Access to manipulate the data in the imported Visual FoxPro tables. The data
you import is a snapshot of the data stored in Visual FoxPro; changes you make to imported data are not
sent back to the Visual FoxPro data source.
If you want changes you make in Microsoft Access to change the data on the Visual FoxPro data source, see
Querying and Updating Visual FoxPro Data from Microsoft Access.
Accessing a Visual FoxPro Data Source from
Microsoft Excel
12/20/2017 • 1 min to read • Edit Online

If you have Microsoft Query installed, you can create a data source in Microsoft Excel that connects to Visual
FoxPro data.
To access Visual FoxPro data from Microsoft Excel
1. Open a Microsoft Excel spreadsheet.
2. From the Data menu, choose Get External Data. Microsoft Query opens.
3. In the Select Data Source dialog box, click Other.
4. In the ODBC Data Sources dialog box, click New.
5. In the Add Data Source dialog box, select Microsoft Visual FoxPro Driver from the Installed ODBC Drivers
list box and click OK.
6. In the ODBC Visual FoxPro Setup dialog box, enter the data source name, select the Database type, enter
the path to the database or directory, and click OK.
The new data source name is displayed in the Enter Data Source text box of the ODBC Data Sources dialog
box.
7. Click OK.
The new data source name is selected in the Available Data Sources text box of the Select Data Source
dialog box.
8. Click Use.
You can now add tables to the open query. For more information about building a query, see Importing
Data into Microsoft Excel from a Visual FoxPro Database.
Importing Data into Microsoft Excel from a Visual
FoxPro Database
12/20/2017 • 1 min to read • Edit Online

You can import Visual FoxPro data into your Microsoft Excel worksheet if you have defined a data source for it. For
information about creating a Visual FoxPro data source, see Accessing a Visual FoxPro Data Source from
Microsoft Excel.
To import Visual FoxPro data into an Microsoft Excel worksheet
1. Open a Microsoft Excel spreadsheet.
2. From the Data menu, choose Get External Data. Microsoft Query opens.
3. In the Select Data Source dialog box, select a Visual FoxPro data source and then click Use.
4. If the database accessed by your data source includes tables, select a table from the Add Tables dialog box.
Microsoft Query displays the added table in the top half of the query designer.

NOTE
The Owner list is not available in this dialog box because the driver does not support owners. The Database list is not
available because the driver does not support multiple databases in a data source.

5. Select fields for your query by dragging them from the table onto the lower half of the designer.
6. Close Microsoft Query. The data you selected is imported into your Microsoft Excel spreadsheet.
Creating Mailing Labels in Microsoft Word Using
Visual FoxPro Data
12/20/2017 • 1 min to read • Edit Online

You can use Visual FoxPro data in a Microsoft Word for Windows 95 or Windows 98 document. For example, you
might want to create mailing labels from the customer information stored in a Visual FoxPro table.
To create mailing labels
1. In Microsoft Word, create a new blank document.
2. From the Tools menu, choose Mail Merge.
3. In the Mail Merge Helper, choose Create and then select Mailing Labels.
4. Under Main Document, choose Active Window.
5. Under Data Source, choose Get Data and then select Open Data Source.
6. In the Open Data Source dialog box, choose MS Query.
7. In the Select Data Source dialog box, select a Visual FoxPro data source and then click Use.
8. If the database accessed by your data source includes tables, select a table from the Add Tables dialog box.
Microsoft Query displays the added table in the top half of the query designer.
9. Select fields for your query by dragging them from the table onto the lower half of the designer.
10. From the File menu, choose Return Data to Microsoft Word. Microsoft Query closes, and the data you
selected is available for use in your mail merge document.
11. Under Main Document, choose Setup.
12. In the Label Options dialog box, select the printer and label information you want and then click OK.
13. In the Create Labels dialog box, select the fields you want to print on the mailing labels and then click OK.
14. In the Mail Merge Helper, under the Merge the Data with the Document, click Merge.
15. In the Merge dialog box, select the options you want and then click Merge.
Visual FoxPro ODBC Driver Programmer's Reference
12/20/2017 • 1 min to read • Edit Online

This section of the Visual FoxPro ODBC Driver documentation contains the following topics:
Bookmark Support
Supported Concurrency Model
Supported Cursor Model
Supported Data Types
International Support
Support for Rules, Triggers, Default Values, and Stored Procedures
Supported ODBC SQL Grammar
Registry Entries
Supported Scalar Functions
Supported SET Commands
Thread Support
Unsupported FoxPro Commands and Functions
Error Messages
Troubleshooting
Bookmark Support (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The Visual FoxPro ODBC Driver supports simple bookmarks. When you call SQLGetInfo with the
SQL_BOOKMARK_PERSISTENCE InfoType, the return value is SQL_BP_SCROLL.
For more information about bookmarks, see Bookmarks (ODBC ).
Supported Concurrency Model (Visual FoxPro ODBC
Driver)
12/20/2017 • 1 min to read • Edit Online

The Visual FoxPro ODBC Driver supports read -only concurrency. Your application can call SQLSetStmtOption
with a SQL_CONCURRENCY option of SQL_CONCUR_READ_ONLY.
For more information, see the ODBC Programmer's Reference.

read-only concurrency
The cursor cannot be updated.

row versioning
Essentially timestamp support, in which row versions are compared at update time.
Supported Cursor Model (Visual FoxPro ODBC
Driver)
12/20/2017 • 1 min to read • Edit Online

The Visual FoxPro ODBC Driver supports both block (rowset) and static cursors. Static cursors are supported for
any driver that conforms to Level 1 ODBC compliance. The driver does not support dynamic, keyset-driven, or
mixed (keyset and dynamic) cursors.
Your application can call SQLSetStmtOption with a SQL_CURSOR_TYPE option of
SQL_CURSOR_FORWARD_ONLY (block cursor) or SQL_CURSOR_STATIC (static cursor).

NOTE
If you call SQLSetStmtOption with a SQL_CURSOR_TYPE option other than SQL_CURSOR_FORWARD_ONLY or
SQL_CURSOR_STATIC, the function returns SQL_SUCCESS_WITH_INFO with a SQLSTATE of 01S02 (Option value changed).
The driver sets all unsupported cursor modes to SQL_CURSOR_STATIC.

For more information about cursor types and about SQLSetStmtOption, see the ODBC Programmer's Reference.

block cursor
A forward-scrolling, read-only result set returned to the client, who is responsible for maintaining storage for the
data.

static cursor
A snapshot of a data set defined by the query. Static cursors do not reflect real-time changes of the underlying data
by other users. The cursor's memory buffer is maintained by the ODBC cursor library, which allows forward and
backward scrolling.

rowset
Blocks of data stored in a cursor, representing rows retrieved from a data source.
Supported Data Types (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The list of data types supported by the driver are presented through the ODBC API and in Microsoft Query.

Data Types in C Applications


You can obtain a list of data types supported by the Visual FoxPro ODBC Driver by using the SQLGetTypeInfo
function in C or C++ applications.

Data Types in Applications Using Microsoft Query


If your application uses Microsoft Query to create a new table on a Visual FoxPro data source, Microsoft Query
displays the New Table Definition dialog box. Under Field Description, the Type box lists Visual FoxPro field
data types, represented by single characters.
International Support (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The Microsoft Visual FoxPro ODBC Driver supports:


Double-byte character sets (DBCS )
Multiple collating sequences
A collating sequence defines the sort order for data stored in a Visual FoxPro table or database. By default,
the driver is configured to use the collating sequences that support the language version of your operating
system.
For a list of supported collating sequences, see SET COLL ATE.

locale
The set of information that corresponds to a given language and country/region. A locale indicates specific
settings such as decimal separators, date and time formats, and character-sorting order.

sort order
Sort orders incorporate the sorting rules of different locales, allowing you to sort data in those languages
correctly. In Visual FoxPro, the current sort order determines the results of character expression comparisons and
the order in which the records appear in indexed or sorted tables.
Support for Rules, Triggers, Default Values, and
Stored Procedures (Visual FoxPro ODBC Driver)
12/20/2017 • 4 min to read • Edit Online

You cannot create Visual FoxPro rules, triggers, default values, or stored procedures using the Visual FoxPro
ODBC Driver. However, your application might interact with existing rules, triggers, default values, or stored
procedures as it inserts, updates, or deletes Visual FoxPro data stored in a database.
The following table lists the Visual FoxPro commands and functions supported by the Visual FoxPro ODBC Driver
when the commands or functions exist in rules, triggers, default values, or stored procedures.
If your application interacts with data whose rules, triggers, default values, or stored procedures call any other
Visual FoxPro commands or functions, the driver generates an error. See Unsupported Visual FoxPro Commands
and Functions for a list of commands and functions not supported by the driver.

TIP
If you want to insert conditional code into your rules, triggers, or stored procedures that determines the commands to
execute when called by the driver, you can use the VERSION( ) function. The VERSION( ) function returns "Visual FoxPro
ODBC Driver <version>" when called by the driver.

Visual FoxPro Commands and Functions Supported in Rules, Triggers,


Default Values, and Stored Procedures

$ Operator % Operator & Command

&& Command * Command = Command

ABS( ) Function ACOPY( ) Function ADD TABLE Command

ADATABASES( ) Function ADBOBJECTS( ) Function AERROR( ) Function

ADEL( ) Function AELEMENT( ) Function ALEN( ) Function

AFIELDS( ) Function AINS( ) Function ALTER TABLE - SQL Command

ALIAS( ) Function ALLTRIM( ) Function APPEND FROM ARRAY Command

AND Operator APPEND Command APPEND MEMO Command

APPEND FROM Command APPEND GENERAL Command ASCAN( ) Function


APPEND PROCEDURES Command ASC( ) Function ASUBSCRIPT( ) Function

ASIN( ) Function ASORT( ) Function ATAN( ) Function

AT( ) Function AT_C( ) Function ATCLINE( ) Function

ATC( ) Function ATCC( ) Function AUSED( ) Function

ATLINE( ) Function ATN2( ) Function

AVERAGE Command ACOS( ) Function

BEGIN TRANSACTION Command BETWEEN( ) Function BITNOT( ) Function

BITCLEAR( ) Function BITLSHIFT( ) Function BITSET( ) Function

BITOR( ) Function BITRSHIFT( ) Function BLANK Command

BITTEST( ) Function BITXOR( ) Function

BOF( ) Function BITAND( ) Function

CALCULATE Command CANDIDATE( ) Function CHR( ) Function

CDX( ) Function CEILING( ) Function CLOSE Commands

CHRTRAN( ) Function CHRTRANC( ) Function COPY INDEXES Command

CMONTH( ) Function CONTINUE Command COPY STRUCTURE EXTENDED


Command

COPY PROCEDURES Command COPY STRUCTURE Command COPY TO Command

COPY TAG Command COPY TO ARRAY Command CPCONVERT( ) Function

COS( ) Function COUNT Command CTOD( ) Function

CPCURRENT( ) Function CPDBF( ) Function CURSORSETPROP( ) Function

CTOT( ) Function CURSORGETPROP( ) Function

CURVAL( ) Function CDOW( ) Function


D

DATE( ) Function DATETIME( ) Function DAY( ) Function

DBC( ) Function DBF( ) Function DBGETPROP( ) Function

DBUSED( ) Function DELETE - SQL Command DELETE Command

DELETE TAG Command DELETED( ) Function DESCENDING( ) Function

DIFFERENCE( ) Function DIMENSION Command DISKSPACE( ) Function

DMY( ) Function DO CASE ... ENDCASE Command DO Command

DO WHILE ... ENDDO Command DOW( ) Function DTOC( ) Function

DTOR( ) Function DTOS( ) Function DTOT( ) Function

EMPTY( ) Function EVALUATE( ) Function EXIT Command

ERROR( ) Function EXP( ) Function

END TRANSACTION Command EOF( ) Function

FCOUNT( ) Function FDATE( ) Function FIELD( ) Function

FILE( ) Function FILTER( ) Function FLDLIST( ) Function

FLOCK( ) Function FLOOR( ) Function FLUSH Command

FOR ... ENDFOR Command FOR( ) Function FOUND( ) Function

FREE TABLE Command FSIZE( ) Function FTIME( ) Function

FULLPATH( ) Function FUNCTION Command FV( ) Function

GATHER Command GETNEXTMODIFIED( ) Function GO/GOTO Command

GETFLDSTATE( ) Function GOMONTH( ) Function


GETCP( ) Function GETENV( ) Function

HEADER( ) Function HOUR( ) Function

IDXCOLLATE( ) Function IF ... ENDIF Command IIF( ) Function

INDBC( ) Function INDEX Command INLIST( ) Function

INSERT-SQL Command INT( ) Function ISALPHA( ) Function

ISBLANK( ) Function ISDIGIT( ) Function ISEXCLUSIVE( ) Function

ISLEADBYTE( ) Function ISLOWER( ) Function ISNULL( ) Function

ISREADONLY( ) Function ISUPPER( ) Function

KEY( ) Function KEYMATCH( ) Function

LEFT( ) Function LEFTC( ) Function LIKEC( ) Function

LENC( ) Function LIKE( ) Function LOCK( ) Function

LOCAL Command LOCATE Command LOOKUP( ) Function

LOG( ) Function LOG10( ) Function LTRIM( ) Function

LOWER( ) Function LPARAMETERS Command

LUPDATE( ) Function LEN( ) Function

_MLINE System Memory Variable MAX( ) Function MDX( ) Function


MDY( ) Function MEMLINES( ) Function MESSAGE( ) Function

MIN( ) Function MINUTE( ) Function MLINE( ) Function

MOD( ) Function MONTH( ) Function MTON( ) Function

NDX( ) Function NORMALIZE( ) Function NOT Operator

NOTE Command NTOM( ) Function NVL( ) Function

OCCURS( ) Function OLDVAL( ) Function ON ERROR Command

ON KEY Command ON( ) Function OPEN DATABASE Command

OR Operator ORDER( ) Function OS( ) Function

PACK Command PARAMETERS( ) Function PAYMENT( ) Function

PARAMETERS Command PRIMARY( ) Function PRIVATE Command

PI( ) Function PROGRAM( ) Function PROPER( ) Function

PROCEDURE Command PV( ) Function

PUBLIC Command PADL( ) | PADR( ) | PADC( ) Functions

RAND( ) Function RAT( ) Function RATC( ) Function

RATLINE( ) Function RECALL Command RECCOUNT( ) Function

RECNO( ) Function RECSIZE( ) Function REGIONAL Command

RELATION( ) Function REMOVE TABLE Command REPLACE Command

REPLACE FROM ARRAY Command REPLICATE( ) Function RETRY Command


RETURN Command RIGHT( ) Function RIGHTC( ) Function

RLOCK( ) Function ROLLBACK Command ROUND( ) Function

RTOD( ) Function RTRIM( ) Function

SCAN ... ENDSCAN Command SCATTER Command SEC( ) Function

SECONDS( ) Function SEEK Command SEEK( ) Function

SELECT Command SELECT( ) Function SELECT-SQL Command

SET BLOCKSIZE Command SET CARRY Command SET CENTURY Command

SET COLLATE Command SET DATABASE Command SET DATE Command

SET DEFAULT Command SET DELETED Command SET EXACT Command

SET EXCLUSIVE Command SET FDOW Command SET FIELDS Command

SET FILTER Command SET FIXED Command SET FULLPATH Command

SET FWEEK Command SET HOURS Command SET INDEX Command

SET LOCK Command SET MULTILOCKS Command SET NEAR Command

SET NOCPTRANS Command SET NOTIFY Command SET NULL Command

SET OPTIMIZE Command SET ORDER Command SET PATH Command

SET PROCEDURE Command SET RELATION Command SET RELATION OFF Command

SET REPROCESS Command SET SKIP Command SET UDFPARMS Command

SET UNIQUE Command SET VOLUME Command SET( ) Function

SETFLDSTATE( ) Function SIGN ( ) Function SIN( ) Function

SKIP Command SORT Command SPACE( ) Function

SQRT( ) Function STORE Command STR( ) Function

STRCONV( ) Function STRTRAN( ) Function STUFF( ) Function

STUFFC( ) Function SUBSTR( ) Function SUBSTRC( ) Function

SUM Command SYS(2011) Function


T

_TALLY System Memory Variable _TRIGGERLEVEL System Memory TAGCOUNT( ) Function


Variable

TABLEUPDATE( ) Function TAG( ) Function TARGET( ) Function

TAGNO( ) Function TAN( ) Function TRIM( ) Function

TIME( ) Function TOTAL Command TXNLEVEL( ) Function

TTOC( ) Function TTOD( ) Function

TYPE( ) Function TABLEREVERT( ) Function

UNIQUE( ) Function UNLOCK Command USE Command

UPDATE Command UPPER( ) Function

USED( ) Function UPDATE - SQL Command

VAL( ) Function VERSION( ) Function

WEEK( ) Function

YEAR( ) Function

ZAP Command
Supported ODBC SQL Grammar (Visual FoxPro
ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The Microsoft Visual FoxPro ODBC Driver supports the following:


All SQL statements and clauses in the ODBC minimum SQL grammar
An additional SQL statement from the ODBC core SQL grammar
The following table lists the items supported by the driver, by ODBC SQL Grammar level.

LEVEL ELEMENTS ITEM

Minimum Data Definition Language (DDL) CREATE TABLE and DROP TABLE

Data Manipulation Language (DML) SELECT, INSERT, UPDATE, and DELETE

Expressions Simple (such as A>B+C)

Data types CHAR, VARCHAR, or LONG VARCHAR

In addition to the supported ODBC SQL grammar, the Visual FoxPro ODBC Driver supports the complete native
Visual FoxPro language syntax for the following Visual FoxPro commands:
ALTER TABLE
CREATE TABLE
DELETE
DELETE TAG
DROP TABLE
INDEX
INSERT
SELECT
UPDATE
Registry Entries (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

When you install the Visual FoxPro ODBC Driver, the installation program updates your system's registry, in the
registry key HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCInst.ini, to add a new key called Microsoft
Visual FoxPro Driver. Under that key, the values described in the following table are added.

VALUE NAME VALUE TYPE VALUE

APILevel REG_SZ "1"

ConnectFunctions REG_SZ "YYN"

Driver REG_SZ System path to the vfpodbc.dll file

DriverODBCVer REG_SZ "02.50"

FileExtns REG_SZ "*.dbf,*.cdx,*.fpt"

FileUsage REG_SZ "1"

Setup REG_SZ System path to the vfpodbc.dll file

SQLLevel REG_SZ "0"

The installation program also adds the key "Visual FoxPro Files", representing the default Visual FoxPro driver, to
your system's HKEY_CURRENT_USER\SOFTWARE\ODBC\Odbc.ini key. Under this key, the installation program
adds the values described in the following table.

VALUE NAME VALUE TYPE VALUE

Driver REG_SZ System path to the vfpodbc.dll file

Each time you add a Visual FoxPro ODBC data source to your ODBC configuration, a new key is added for that
data source name. The values for the data source correspond to values you set in the ODBC Visual FoxPro
Setup dialog box, as listed in the following table.

VALUE NAME (KEYWORD) VALUE TYPE VALUE

Collate REG_SQ Any supported collating sequence

Description REG_SZ User description of data source

Driver System path to the vfpodbc.dll file

Exclusive Yes or No

BackgroundFetch Yes or No
VALUE NAME (KEYWORD) VALUE TYPE VALUE

SourceDB REG_SZ Path to .DBC file

SourceType REG_SZ "DBC" or "DBF"

You should not access this information directly; any administration of the registry is handled by the ODBC
Administrator when you add, modify, or delete a data source.
You can use some of these keywords and values as parameters in the SQLDriverConnect ODBC API function.
Supported Scalar Functions (Visual FoxPro ODBC
Driver)
12/20/2017 • 1 min to read • Edit Online

The Visual FoxPro ODBC Driver supports three types of scalar functions as defined in the ODBC SQL grammar:
string, numeric, and time and date functions.
This section contains the following topics.
String Functions (Visual FoxPro ODBC Driver)
Numeric Functions (Visual FoxPro ODBC Driver)
Time and Date Functions (Visual FoxPro ODBC Driver)
String Functions (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The following table lists ODBC string manipulation functions supported by the Visual FoxPro ODBC Driver; when
the Visual FoxPro grammar for the same function differs from the ODBC syntax, the Visual FoxPro equivalent is
listed.

ODBC GRAMMAR VISUAL FOXPRO GRAMMAR

ASCII (string_exp) ASC (string_exp)

CHAR (code) CHR (string_exp)

CONCAT (string_exp1, string_exp2) string_exp1 + string_exp2

DIFFERENCE (string_exp1, string_exp2)

INSERT (string_exp1, start, length, string_exp2) STUFF (string_exp1, start, length, string_exp2)

LCASE (string_exp) LOWER (string_exp)

LEFT (string_exp, count )

LENGTH (string_exp) LEN (string_exp)

LTRIM (string_exp)

REPEAT (string_exp, count ) REPLICATE (string_exp, count )

REPLACE (string_exp1, string_exp2, string_exp3) STRTRAN (string_exp1, string_exp2, string_exp3)

RIGHT (string_exp, count )

RTRIM (string_exp)

SOUNDEX (string_exp)

SPACE (count )

SUBSTRING (string_exp, start, length) SUBSTR (string_exp, start, length)

UCASE (string_exp) UPPER (string_exp)


Numeric Functions (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The following table describes ODBC numeric functions supported by the Visual FoxPro ODBC Driver; when the
Visual FoxPro grammar for the same function differs from the ODBC syntax, the Visual FoxPro equivalent is listed.

ODBC GRAMMAR VISUAL FOXPRO GRAMMAR

ABS (numeric_exp)

ACOS (float_exp)

ASIN (float_exp)

ATAN (float_exp)

ATAN2 (float_exp1, float_exp2) ATN2 (float_exp1, float_exp2)

CEILING (numeric_exp)

COS (float_exp)

COT (float_exp)

DEGREES (numeric_exp) RTOD (numeric_exp)

EXP (float_exp)

FLOOR (numeric_exp)

LOG (float_exp)

LOG10 (float_exp)

MOD (integer_exp1, integer_exp2)

PI ( )

RADIANS (numeric_exp) DTOR (numeric_exp)

RAND ([integer_exp])

ROUND (numeric_exp, integer_exp)

SIGN (numeric_exp)

SIN (float_exp)

SQRT (float_exp)
ODBC GRAMMAR VISUAL FOXPRO GRAMMAR

TAN (float_exp)

The following numeric functions are not supported:


POWER (numeric_exp, integer_exp )
TRUNCATE (numeric_exp, integer_exp )
Time and Date Functions (Visual FoxPro ODBC
Driver)
12/20/2017 • 1 min to read • Edit Online

The following table lists ODBC time and date functions supported by the Visual FoxPro ODBC Driver; when the
Visual FoxPro grammar for the same function differs from the ODBC syntax, the Visual FoxPro equivalent is listed.

ODBC GRAMMAR VISUAL FOXPRO GRAMMAR

CURDATE( ) DATE( )

CURTIME( ) TIME( )

DAYNAME(date_exp) CDOW(date_exp)

DAYOFMONTH(date_exp) DAY( )

HOUR(time_exp)

MINUTE(time_exp)

MONTH(time_exp)

MONTHNAME(date_exp) CMONTH(date_exp)

NOW( ) DATETIME( )

SECOND(time_exp) SEC(time_exp)

WEEK(date_exp)

YEAR(date_exp)

The following time and date functions are not supported:


DAYOFYEAR (date_exp )
QUARTER (date_exp )
TIMESTAMPADD (interval, integer_exp, timestamp_exp )
TIMESTAMPDIFF (interval, timestamp_exp1, timestamp_exp2 )

ODBC Escape Sequences


The driver also supports the ODBC escape sequence for date and timestamp data. The escape clause syntax is as
follows:
--(*vendor(Microsoft),product(ODBC) d 'value' *)—
--(*vendor(Microsoft),product(ODBC) ts ''value' *)—

In this syntax, d indicates that value is a date in the yyyy-mm -dd format and ts indicates that value is a timestamp
in the yyyy-mm -dd hh:mm:ss[.f...] format. The shorthand syntax for date and timestamp data is as follows:

{d 'value'}
{ts 'value'}

For example, each of the following statements updates the ALLTYPES table by using the date and timestamp
shorthand syntax in a supported SQL UPDATE command:

UPDATE alltypes
SET DAT_COL={d'1968-04-28'}
WHERE KEY=111

UPDATE alltypes
SET DTI_COL={ts'1968-04-28 12:00:00'}
WHERE KEY=111

Remarks
For more information about escape sequences, see Escape Sequences in ODBC in the ODBC Programmer's
Reference.
Supported SET Commands (Visual FoxPro ODBC
Driver)
12/20/2017 • 1 min to read • Edit Online

Your application can send the following Visual FoxPro SET commands to a data source:
SET ANSI
SET BLOCKSIZE
SET COLL ATE
SET DELETED
SET EXACT
SET EXCLUSIVE
SET NULL
SET PATH
SET REPROCESS
SET UNIQUE
Thread Support (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The Visual FoxPro ODBC Driver is thread-safe. Access to environment handles (hen), connection handles (hdbc),
and statement handles (hstmt) is wrapped in appropriate semaphores to prevent other processes from accessing
and potentially altering the driver's internal data structures.
In a multithreaded application, you can cancel a function that is running synchronously on an hstmt by calling
SQLCancel on a separate thread.
The driver uses a separate thread to fetch data when you use progressive fetching. To use progressive fetching for
a data source, select the Fetch data in background check box on the ODBC Visual FoxPro Setup dialog box or
use the BackgroundFetch attribute keyword in your connection string. Avoid using background fetch when you call
the driver from multithreaded applications. For information about connection string attribute keywords, see Using
Connection Strings.
For more information about threads and SQLCancel, see SQLCancel in the ODBC Programmer's Reference.
Unsupported Visual FoxPro Commands and
Functions (Visual FoxPro ODBC Driver)
12/20/2017 • 7 min to read • Edit Online

The following table lists FoxPro commands and functions that are not supported by the Visual FoxPro ODBC
Driver but are supported by Microsoft® Visual FoxPro®.
If your application interacts with data whose rules, triggers, default values, or stored procedures call these Visual
FoxPro commands or functions, the driver can generate an error.

Unsupported Visual FoxPro Commands and Functions

#DEFINE ... #UNDEF #IF ... #ENDIF Preprocessor Directive #IFDEF | #IFNDEF

#INCLUDE Preprocessor Directive :: Scope Resolution Operator ! Command (see RUN | ! Command)

? | ?? Command ??? Command \ | \\ Command

@ ... BOX Command @ ... CLASS Command @ ... CLEAR Command

@ ... EDIT - Edit Boxes Command @ ... FILL Command @ ... GET

@ ... MENU Command @ ... PROMPT Command @ ... SAY Command

@ ... SCROLL Command @ ... TO Command

ACCEPT Command ACLASS( ) Function ACTIVATE MENU Command

ACTIVATE POPUP Command ACTIVATE SCREEN Command ACTIVATE WINDOW Command

ActivateCell Method ADD CLASS Command ADIR( ) Function

AFONT( ) Function AINSTANCE( ) Function _ALIGNMENT System Memory Variable

AMEMBERS( ) Function ANSITOOEM( ) Function APRINTERS( ) Function

ASELOBJ( ) Function ASSIST Command

BAR( ) Function BARCOUNT( ) Function BARPROMPT( ) Function


_BEAUTIFY System Memory Variable _BOX System Memory Variable BROWSE Command

_BROWSER System Memory Variable BUILD APP Command BUILD EXE Command

BUILD PROJECT Command _BUILDER System Memory Variable

_CALCVALUE System Memory Variable _CLIPTEXT System Memory Variable _CONVERTER System Memory Variable

_CUROBJ System Memory Variable CALL Command CANCEL Command

CAPSLOCK( ) Function CD Command CHANGE Command

CHDIR Command CHRSAW( ) Function CLOSE MEMO Command

CNTBAR( ) Function CNTPAD( ) Function COL( ) Function

COMPILE Command COMPILE DATABASE Command COMPILE FORM Command

COMPOBJ( ) Function Container Object Control Object

COPY FILE Command COPY MEMO Command CREATE CLASS Command

CREATE CLASSLIB Command CREATE COLOR SET Command CREATE Command

CREATE CONNECTION Command CREATE DATABASE Command CREATE FORM Command

CREATE FROM Command CREATE LABEL Command CREATE MENU Command

CREATE PROJECT Command CREATE QUERY Command CREATE REPORT Command

CREATE SCREEN Command CREATE SQL VIEW Command CREATE TRIGGER Command

CREATE VIEW Command CREATEOBJECT( ) Function CURDIR( ) Function

_DBLCLICK System Memory Variable _DIARYDATE System Memory Variable DBSETPROP( ) Function

DDE Functions DEACTIVATE MENU Command DEACTIVATE POPUP Command

DEACTIVATE WINDOW Command DECLARE - DLL Command DECLARE Command

DEFINE BAR Command DEFINE BOX Command DEFINE CLASS Command

DEFINE MENU Command DEFINE PAD Command DEFINE POPUP Command


DEFINE WINDOW Command DELETE CONNECTION Command DELETE DATABASE Command

DELETE FILE Command DELETE TRIGGER Command DELETE VIEW Command

DIR Command DIRECTORY Command DISPLAY Command

DISPLAY CONNECTIONS Command DISPLAY DATABASE Command DISPLAY DLLS Command

DISPLAY FILES Command DISPLAY MEMORY Command DISPLAY OBJECTS Command

DISPLAY PROCEDURES Command DISPLAY STATUS Command DISPLAY STRUCTURE Command

DISPLAY TABLES Command DISPLAY VIEWS Command DO FORM Command

EDIT Command ERROR Command

ERASE Command EXTERNAL Command EXPORT Command

EJECT Command EJECT PAGE Command

_FOXDOC System Memory Variable _FOXGRAPH System Memory Variable FEOF( ) Function

FCLOSE( ) Function FCREATE( ) Function FGETS( ) Function

FERROR( ) Function FFLUSH( ) Function FKLABEL( ) Function

FILER Command FIND Command FOPEN( ) Function

FKMAX( ) Function FONTMETRIC( ) Function FSEEK( ) Function

FPUTS( ) Function FREAD( ) Function

FWRITE( ) Function FCHSIZE( ) Function

_GENGRAPH System Memory Variable _GENMENU System Memory Variable _GENPD System Memory Variable

_GENSCRN System Memory Variable _GENXTAB System Memory Variable GETBAR( ) Function

GETCOLOR( ) Function GETDIR( ) Function GETEXPR Command


GETFILE( ) Function GETFONT( ) Function GETOBJECT( ) Function

GETPAD( ) Function GETPICT( ) Function GETPRINTER( ) Function

HELP Command HIDE MENU Command HIDE POPUP Command

HIDE WINDOW Command HOME( ) Function

IMESTATUS( ) Function IMPORT Command INPUT Command

INDEX ON Command INKEY( ) Function ISCOLOR( ) Function

INSERT Command INSMODE( ) Function

ISMOUSE( ) Function _INDENT System Memory Variable

JOIN Command

KEYBOARD Command

_LMARGIN System Memory Variable LABEL Command LASTKEY( ) Function

LINENO( ) Function LIST Commands LIST CONNECTIONS Command

LOAD Command LOCFILE( ) Function

MCOL( ) Function MD Command MENU TO Command


MEMORY( ) Function MENU Command MKDIR Command

MENU( ) Function MESSAGEBOX( ) Function MODIFY CONNECTION Command

MODIFY CLASS Command MODIFY COMMAND Command MODIFY FORM Command

MODIFY DATABASE Command MODIFY FILE Command MODIFY MEMO Command

MODIFY GENERAL Command MODIFY LABEL Command MODIFY PROJECT Command

MODIFY MENU Command MODIFY PROCEDURE Command MODIFY SCREEN Command

MODIFY QUERY Command MODIFY REPORT Command MODIFY WINDOW Command

MODIFY STRUCTURE Command MODIFY VIEW Command MOVE WINDOW Command

MOUSE Command MOVE POPUP Command MROW( ) Function

MRKBAR( ) Function MRKPAD( ) Function

MWINDOW( ) Function MDOWN( ) Function

NUMLOCK( ) Function

OBJNUM( ) Function OBJTOCLIENT( ) Function ON BAR Command

OEMTOANSI( ) Function ON APLABOUT Command ON EXIT MENU Command

ON ESCAPE Command ON EXIT BAR Command ON KEY = Command

ON EXIT PAD Command ON EXIT POPUP Command ON PAD Command

ON KEY LABEL Command ON MACHELP Command ON SELECTION BAR Command

ON PAGE Command ON READERROR Command ON SELECTION POPUP Command

ON SELECTION MENU Command ON SELECTION PAD Command

ON SHUTDOWN Command OBJVAR( ) Function

P
_PADVANCE System Memory Variable _PAGENO System Memory Variable _PBPAGE System Memory Variable

_PCOLNO System Memory Variable _PCOPIES System Memory Variable _PDRIVER System Memory Variable

_PDSETUP System Memory Variable _PECODE System Memory Variable _PEJECT System Memory Variable

_PEPAGE System Memory Variable _PLENGTH System Memory Variable _PLINENO System Memory Variable

_PLOFFSET System Memory Variable _PPITCH System Memory Variable _PQUALITY System Memory Variable

_PRETEXT System Memory Variable _PSCODE System Memory Variable _PSPACING System Memory Variable

_PWAIT System Memory Variable PACK DATABASE Command PAD( ) Function

PCOL( ) Function PEMSTATUS( ) Function PLAY MACRO Command

POP KEY Command POP MENU Command POP POPUP Command

POPUP( ) Function PRINTJOB ... ENDPRINTJOB Command PRINTSTATUS( ) Function

PRMBAR( ) Function PRMPAD( ) Function PROMPT( ) Function

PROW( ) Function PRTINFO( ) Function PUSH KEY Command

PUSH MENU Command PUSH POPUP Command PUTFILE( ) Function

QUIT Command

_RMARGIN System Memory Variable RD Command READKEY( ) Function

READ Command READ MENU Command RELEASE BAR Command

REFRESH() Function REINDEX Command RELEASE LIBRARY Command

RELEASE CLASSLIB Command RELEASE Command RELEASE PAD Command

RELEASE MENUS Command RELEASE MODULE Command RELEASE WINDOWS Command

RELEASE POPUPS Command RELEASE PROCEDURE Command RENAME Command

REMOVE CLASS Command RENAME CLASS Command RENAME VIEW Command

RENAME CONNECTION Command RENAME TABLE Command RESTORE FROM Command


REPORT Command REQUERY( ) Function RESTORE WINDOW Command

RESTORE MACROS Command RESTORE SCREEN Command RGBSCHEME( ) Function

RESUME Command RGB( ) Function RUN | ! Command

RMDIR Command ROW( ) Function

RUNSCRIPT Command RDLEVEL( ) Function

SAVE MACROS Command SAVE SCREEN Command SAVE TO Command

SAVE WINDOWS Command SCHEME( ) Function SCOLS( ) Function

SCROLL Command _SCREEN System Memory Variable SET Command

SET ALTERNATE Command SET ANSI Command SET APLABOUT Command

SET AUTOSAVE Command SET BELL Command SET BLINK Command

SET BORDER Command SET BRSTATUS Command SET CLASSLIB Command

SET CLEAR Command SET CLOCK Command SET COLOR OF Command

SET COLOR OF SCHEME Command SET COLOR SET Command SET COLOR TO Command

SET COMPATIBLE Command SET CONFIRM Command SET CONSOLE Command

SET CPCOMPILE SET CPDIALOG SET CURRENCY Command

SET CURSOR Command SET DATASESSION Command SET DEBUG Command

SET DECIMALS Command SET DELIMITERS Command SET DEVELOPMENT Command

SET DEVICE Command SET DISPLAY Command SET DOHISTORY Command

SET ECHO Command SET ESCAPE Command SET FORMAT Command

SET FUNCTION Command SET HEADINGS Command SET HELP Command

SET HELPFILTER Command SET INTENSITY Command SET KEY Command

SET KEYCOMP Command SET LOGERRORS Command SET MACDESKTOP Command

SET MACHELP Command SET MACKEY Command SET MARGIN Command

SET MARK OF Command SET MARK TO Command SET MEMOWIDTH Command


SET MESSAGE Command SET MOUSE Command SET ODOMETER Command

SET OLEOBJECT Command SET PALETTE Command SET PDSETUP Command

SET POINT Command SET PRINTER Command SET READBORDER Command

SET REFRESH Command SET RESOURCE Command SET SAFETY Command

SET SCOREBOARD Command SET SECONDS Command SET SEPARATOR Command

SET SHADOWS Command SET SKIP OF Command SET SPACE Command

SET STATUS Command SET STATUS BAR Command SET STEP Command

SET STICKY Command SET SYSFORMATS Command SET SYSMENU Command

SET TALK Command SET TEXTMERGE Command SET TEXTMERGE DELIMITERS Command

SET TOPIC Command SET TOPIC ID Command SET TRBETWEEN Command

SET TYPEAHEAD Command SET VIEW Command SET WINDOW OF MEMO Command

SET XCMDFILE Command _SHELL System Memory Variable SHOW GET Command

SHOW GETS Command SHOW MENU Command SHOW OBJECT Command

SHOW POPUP Command SHOW WINDOW Command SIZE POPUP Command

SIZE WINDOW Command SKPBAR( ) Function SKPPAD( ) Function

SOUNDEX( ) Function _SPELLCHK System Memory Variable SQL functions

SROWS( ) Function _STARTUP System Memory Variable SUSPEND Command

SYS() Functions except SYS(2011) SYSMETRIC( ) Function

_TABS System Memory Variable TEXT ... ENDTEXT Command TXTWIDTH( ) Function

TRANSFORM( ) Function _TRANSPORT System Memory Variable

TYPE Command _THROTTLE System Memory Variable

UPDATED( ) Function USE Command


V

VALIDATE DATABASE Command VARREAD( ) Function VERSION( ) Function

_WINDOWS System Memory Variable _WIZARD System Memory Variable WCHILD( ) Function

WAIT Command WBORDER( ) Function WFONT( ) Function

WCOLS( ) Function WEXIST( ) Function WLROW( ) Function

WITH ... ENDWITH Command WLAST( ) Function WONTOP( ) Function

WMAXIMUM( ) Function WLCOL( ) Function WREAD( ) Function

WOUTPUT( ) Function WMINIMUM( ) Function WVISIBLE( ) Function

WPARENT( ) Function WTITLE( ) Function

WROWS( ) Function _WRAP System Memory Variable

ZOOM WINDOW Command


Error Messages (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

When an error occurs, the Visual FoxPro driver returns the following information:
The native error number and error message text
The SQLSTATE (an ODBC error code) and error message text
You access this error information by calling SQLError.

Native Errors
For errors that occur in the data source, the Visual FoxPro driver returns the native error number and error
message text. For a list of native error numbers, see Visual FoxPro ODBC Driver Native Error Messages.

SQLSTATE (ODBC Error Codes)


For errors that are detected and returned by the Visual FoxPro driver, the driver maps the returned native error
number to the appropriate SQLSTATE. If a native error number does not have an ODBC error code to map to, the
Visual FoxPro driver returns SQLSTATE S1000 (General error).
For a list of SQLSTATE values generated by the Visual FoxPro ODBC Driver for corresponding Visual FoxPro
errors, see ODBC Error Codes.

Syntax
Error messages have the following format:
[ vendor ][ ODBC_component ] error_message
The prefixes in brackets ([ ]) identify the source of the error as defined in the following table.

DATA SOURCE PREFIX VALUE

Driver Manager [vendor] [Microsoft]


[ODBC_component] [ODBC Driver Manager]
[data_source] N/A

Visual FoxPro driver vendor] [Microsoft]


[ODBC_component] [ODBC Visual FoxPro driver]
[data_source] N/A

For example, if the Visual FoxPro ODBC Driver could not find the file employee.dbf, it might return the following
error message:
"[Microsoft][ODBC Visual FoxPro Driver]File 'employee.dbf' does not exist"
Visual FoxPro ODBC Driver Native Error Messages
12/20/2017 • 9 min to read • Edit Online

The following tables list error messages native to the Visual FoxPro ODBC Driver.

001

1 Feature is not available.

2 Input/output operation failure.

3 Free handle is not found.

5 Use of unallocated handle.

99 Procedure canceled.

100

100 Too many files open.

101 Cannot open file.

102 Cannot create file.

105 Error writing to file.

107 Invalid key length.

109 Record is out of range.

110 Record is not in index.

111 Invalid file descriptor.

113 File is not open.

114 Not enough disk space for value.

115 Invalid operation for the cursor.

118 Index file does not match table.

119 No table is open.


120 File does not exist.

121 File already exists.

122 Table has no index order set.

123 Not a table.

125 Index expression exceeds maximum length.

127 You must use a logical expression with a FOR or WHILE clause.

128 Not a numeric expression.

129 Variable is not found.

132 File is in use.

133 Index does not match the table. Delete the index file and re-
create the index.

135 End of file encountered.

136 Beginning of file encountered.

137 Alias is not found.

139 You must use a logical expression with FILTER.

142 Cyclic relation.

143 No fields were found to copy.

144 The LOCATE command must be issued before the CONTINUE


command.

145 Must be a character or numeric key field.

146 Cannot write to a read-only file.

147 Target table is already engaged in a relation.

148 Expression has been re-entered while the filter is executing.

149 Not enough memory for buffer.

150 Not enough memory for file map.

155 Invalid buffdirty call.

156 Duplicate field names.


158 No fields found to process.

159 Numeric overflow. Data was lost.

162 Procedure 'value' is not found.

165 value is not related to the current work area.

170 Variable 'value' is not found.

171 Cannot open file value.

173 File 'value' does not exist.

174 'value' is not a memory variable.

175 'value' is not a file variable.

176 'value' is not an array.

177 Alias 'value' is not found.

180 File was not placed in memory using the LOAD command.

182 There is not enough memory to complete this operation.

200

200 Syntax error.

201 Too many names used.

202 Program is too large.

203 Too many memory variables.

205 Nesting error.

206 Recursive macro definition.

209 Line is too long.

210 Allowed DO nesting level exceeded.

211 An IF | ELSE | ENDIF statement is missing.

212 Structure nesting is too deep.


213 There is a missing keyword in the FOR...ENDFOR or DO
CASE...ENDCASE command structure.

219 Command contains unrecognized phrase/keyword.

221 Command is missing required clause.

222 Unrecognized command verb.

224 Invalid subscript reference.

227 Missing expression.

228 Table number is invalid.

229 Too few arguments.

230 Too many arguments.

233 Statement is not allowed in interactive mode.

234 Subscript is outside defined range.

236 Suspend program before using RESUME.

238 No PARAMETER statement is found.

239 Must specify additional parameters.

240 Not a character expression.

250 Too many PROCEDURE commands are in effect.

252 Compiled code for this line is too long.

257 Key string is too long.

291 Expression used with ASIN() is out of range.

292 Cannot use 0 or negative as the argument for LOG10().

293 Expression used with ACOS() is out of range.

294 FOXUSER.DBF file is invalid.

295 Invalid path or file name.

296 Error reading the resource.

297 Command is allowed only in interactive mode.


300

301 Operator/operand type mismatch.

302 Data type mismatch.

305 Expression evaluated to an illegal value.

307 Cannot divide by 0.

308 Insufficient stack space.

337 Cannot nest the PRINTJOB command.

400

406 Printer is not ready.

407 Invalid argument used with the SET function.

410 Unable to create temporary work files.

423 Error creating the OLE object.

424 Error copying the OLE object to the Clipboard.

462 value internal consistency error.

465 SQL pass-through internal consistency error.

466 Connection handle is invalid.

467 Property is invalid for local cursors.

468 Property is invalid for table cursors.

469 Property value is out of bounds.

470 Incorrect property name.

471 Incorrect column format.

473 Environment-level property is invalid.

474 Invalid call issued while executing a SQLEXEC() sequence.

479 Invalid update column name \value\.


489 General fields cannot be used in the WHERE condition of an
update statement. Change the WhereType property of the
view.

491 No update tables are specified. Use the Tables property of the
cursor.

492 No key columns are specified for the update table \value\. Use
the KeyFieldList property of the cursor.

493 SQL parameter is missing.

494 View definition has been changed.

495 Warning: The key defined by the KeyField property for table
value is not unique.

498 SQL SELECT statement is invalid.

499 SQL parameter value is invalid.

500

502 Cannot write to the record because it is in use.

503 File cannot be locked.

508 Error initializing OLE.

520 No database is open or set as the current database.

522 Connectivity internal consistency error.

523 Execution was canceled by the user.

525 Function is not supported on remote tables.

526 Connectivity error: value.

527 Cannot load ODBC library, ODBC32.DLL.

528 ODBC entry point missing, value.

530 Fetching canceled; remote table is closed.

532 Type conversion is not supported.

533 This property is read-only.

536 Function is not supported on native tables.


538 A stored procedure is executing.

540 Session number is invalid.

541 Connection value is busy.

542 Base table fields have been changed and no longer match view
fields. View field properties cannot be set.

543 Type conversion required by the DataType property for field


'value' is invalid.

544 DataType property for field 'value' is invalid.

545 Table buffer for alias \value\ contains uncommitted changes.

546 Cannot close table during execution of table-bound


expression.

547 Cannot insert an empty row from a view into its base table(s).

548 Table value has one or more non-structural indexes open.


Please close them and retry the Begin Transaction.

549 Data session #value cannot be released with open


transaction(s).

550 .DBC internal consistency error.

557 The database must be opened exclusively.

559 Property is not found.

560 Property value is invalid.

561 Database is invalid. Please validate.

562 Cannot find object value in the database.

563 Cannot find view value in the current database.

566 Cannot issue the PACK command on a database while its


tables are in use.

567 Primary key property is invalid; please validate database.

570 Database is read-only.

571 The name value is already used for another

575 Object name is invalid.


577 Table value is referenced in a relation.

578 Invalid database table name.

579 Command cannot be issued on a table with cursors in table


buffering mode.

580 Feature is not supported for non-.DBC tables.

581 Field value does not accept null value.

583 Record validation rule is violated.

585 Update conflict. Use TABLEUPDATE() with the lForce parameter


to commit the update or TABLEREVERT() to roll back the
update.

586 Function requires row or table buffering mode.

587 Illegal nested OLDVAL() or CURVAL().

589 Table or row buffering requires that SET MULTILOCKS is set to


ON.

590 BEGIN TRANSACTION command failed. Nesting level is too


deep.

591 END TRANSACTION command cannot be issued without a


corresponding BEGIN TRANSACTION command.

592 ROLLBACK command cannot be issued without a


corresponding BEGIN TRANSACTION command.

593 Command cannot be issued within a transaction.

594 Illegal to attempt a file lock in a transaction after taking prior


record locks.

596 Table buffering is not enabled.

597 Views require either DB_BUFOPTROW or DB_BUFOPTTABLE.

598 Rule and trigger code must balance transaction usage.

599 Data session #value was forced to ROLLBACK all transactions


to avoid deadlock.

600

601 Alias name is already in use.


602 Operation is invalid for a Memo, General, or Picture field.

612 No such menu or menu item is defined.

618 Menu has not been defined with DEFINE MENU.

624 Menu title has not been defined with DEFINE PAD.

625 Menu has not been defined with DEFINE POPUP.

631 Array dimensions are invalid.

637 File must be opened exclusively to convert the Memo file.

638 Field must be a Memo field.

649 No previous PRINTJOB command to correspond to this


command.

651 CANCEL or SUSPEND is not allowed.

659 The table has memo fields that cannot be converted while
open read-only.

683 Index tag is not found.

700

700 Record is in use by another user.

701 File must be opened exclusively.

702 File is in use by another user.

703 Record is not locked.

705 File access is denied.

706 Cannot sort .IDX files in descending order.

707 Structural .CDX file is not found.

708 File is open in another work area.

712 Field name is a duplicate or invalid.

714 Window 'value' has not been defined.

718 File is read-only.


722 Preprocessor expression is invalid.

734 Property value is not found.

737 value is a method, event, or object.

738 Property value is not a method or event.

740 value is a read-only property.

748 This file is incompatible with the current version of Visual


FoxPro.

750 File was created in a later version of Visual FoxPro than the
current version.

763 Property value already exists.

773 Database object type is invalid.

784 This object is derived from a base class and does not have a
parent class.

800

802 SQL: Cannot locate table.

872 Too many columns.

879 No primary key.

884 Uniqueness of index value is violated.

885 Only structural tags can be defined as candidate.

886 Index does not accept NULL.

887 Illegal recursion in rule evaluation.

888 Tag name is too long.

900

901 Function argument value, type, or count is invalid.

902 Expression evaluator failed.


903 String is too long to fit.

904 ** or ^ domain error.

905 LOG(): Zero or negative used as argument.

906 SQRT() argument cannot be negative.

912 Operation is invalid for a General field.

914 Code page number is invalid.

915 Collating sequence 'value' is not found.

918 File name is too long.

922 Volume does not exist.

923 Object value is not found.

924 value is not an object.

925 Unknown member value.

928 Statement is only valid within a class definition.

929 value can only be used within a method.

930 Cannot redefine value.

931 Statement is not in a procedure.

934 Statement is only valid within a method.

935 The current object does not inherit from class value.

937 Procedure file 'value' is not found.

938 Object is not contained in a value.

939 WITH/ENDWITH mismatch.

940 Expression is not valid outside of WITH/ENDWITH.

941 Error code is invalid.

942 Objects cannot be assigned to arrays.

943 Member value does not evaluate to an object.

945 The current object has been released.


947 Expression is too complex.

951 Cannot clear the object in use.

955 WIN.INI/registry is corrupted.

957 Error accessing printer spooler.

959 Invalid coordinates.

960 Illegal redefinition of variable value.

971 Cannot compile until the current COMPILE command has


completed.

972 Array value is in use.

974 Arrays cannot be assigned to array elements.

976 Cannot resolve backlink.

988 Currency value is out of range.

990 Cancel.

999 Function is not implemented.


ODBC Error Codes (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

The following table lists Visual FoxPro error codes mapped to ODBC Error Code SQLSTATE values. The mapped
SQLSTATE values come from SQLExecDirect and SQLPrepare. No other SQLSTATE values from other ODBC API
are mapped because SQLExecDirect and SQLPrepare are the only functions that access the Visual FoxPro
engine.
For more information on ODBC error codes, see Appendix A: ODBC Error Codes, in the ODBC Programmer's
Reference.

SQLSTATE VISUAL FOXPRO ERROR CODE

S1001 149

150

182

202

308

1004 159

37000 132

200

219

221

222

227

229

230

498

499

713

901

22005 301

302

22012 307
SQLSTATE VISUAL FOXPRO ERROR CODE

23000 581

583

884

886

988

S0001 121

571

S0002 173

120

123

295

562

563

802

S0012 683

S0021 156

712

S0022 158

806

S1000 100

101

102

105

107

109

110

111

113

114

115
SQLSTATE 118
VISUAL FOXPRO ERROR CODE

119

125

133

135

136

137

145

146

171

173

177

201

205

239

240

252

257

296

305

407

410

462

502

503

520

538

550

561

567

570

575

578
SQLSTATE VISUAL FOXPRO ERROR CODE
580

585

602

702

705

707

708

718

750

872

879

887

888

912

914

915

918

922

923

947

976

999
Troubleshooting (Visual FoxPro ODBC Driver)
12/20/2017 • 2 min to read • Edit Online

The following sections discuss how to improve performance and solve problems you might encounter while using
the Visual FoxPro ODBC Driver.

Accessing Parameterized Views


You can't access parameterized views in a Visual FoxPro database using the driver. A parameterized view creates a
WHERE clause in the view's SQL SELECT statement that limits the records downloaded to those records that
meet the conditions of the WHERE clause built using the value supplied for the parameter. Because the driver
doesn't support passing parameters to the view, attempts to access a parameterized view by using the driver will
fail.
The parameter value can be supplied at run time or passed programmatically to the view.

Accessing Remote Views


You can't access remote views in a Visual FoxPro database using the driver. Remote views are views that access
either non-FoxPro data or a combination of FoxPro and non-FoxPro data. To access remote views, use Visual
FoxPro.

Deleting Records
You can mark records for deletion using the driver, but you can't permanently remove records from the database.
To permanently remove records from a table, use Visual FoxPro.

Increasing Performance Using Background Fetching


You can improve performance on large fetches by using the background fetching feature of the driver. Background
fetching uses a separate thread to fetch data requested from a specific data source.
You can employ background fetching for a data source in one of the following ways:
Check the Fetch data in background checkbox on the ODBC Visual FoxPro Setup dialog box.
Use the BackgroundFetch attribute keyword in your connection string.
For information on connection string attribute keywords, see Using Connection Strings.

Updating Multitiered Views


A multitiered view is a view based on one or more views rather than on a base table. When you update data in a
multitiered view, the updates go down only one level, to the view on which the top-level view is based; base tables
are not updated.

Using Data Definition Language (DDL) in Stored Procedures


You can't use DDL, such as CREATE TABLE or ALTER TABLE, in Visual FoxPro stored procedures.
For information on language you can use in stored procedures, see Support for Rules, Triggers, Default Values,
and Stored Procedures.
Using Positioned Updates
The driver doesn't support positioned updates. Use the SQL WHERE clause to identify the rows you want to
update.

Using the SET ANSI Command


If you're a Visual FoxPro developer, you should be aware that the default setting for SET ANSI is ON for the driver,
in contrast to a default setting of OFF for Visual FoxPro. The default ON setting for SET ANSI allows Visual
FoxPro data sources to behave consistently with other ODBC data sources that typically perform exact
comparisons. You can change the default setting. For more information, see SET ANSI.
ODBC Functions and the Visual FoxPro ODBC Driver
12/20/2017 • 1 min to read • Edit Online

The topics in this section provide a brief summary of ODBC API functions and any Visual FoxPro–specific details.

NOTE
For general information about ODBC functions, see ODBC API Reference in "ODBC Programmer's Guide".

The ODBC API functions have been divided into three main categories here: Core Level API functions, Level 1 API
functions, and Level 2 API functions.

NOTE
Several of the functions behave differently depending on whether the data source is defined as a connection to a directory of
free tables (.dbf files) or to a Visual FoxPro database (.dbc file). Certain operations are supported only for database
connections.

Core Level API Support


The ODBC Core Level API functions are listed in the following table. All of these functions are supported by the
Visual FoxPro ODBC Driver.

SQLAllocConnect SQLExecute

SQLAllocEnv SQLFetch

SQLAllocStmt SQLFreeConnect

SQLBindCol SQLFreeEnv

SQLCancel SQLFreeStmt

SQLColAttributes SQLGetCursorName

SQLConnect SQLNumResultCols

SQLDescribeCol SQLPrepare

SQLDisconnect SQLRowCount

SQLError SQLSetCursorName

SQLExecDirect SQLTransact

Level 1 API Support


The ODBC Level 1 API functions are listed in the following table. All of these functions are fully or partially
supported by the Visual FoxPro ODBC Driver.

SQLBindParameter SQLGetTypeInfo

SQLColumns SQLParamData

SQLDriverConnect SQLPutData

SQLGetConnectOption SQLSetConnectOption

SQLGetData SQLSetStmtOption

SQLGetFunctions SQLSpecialColumns

SQLGetInfo SQLStatistics

SQLGetStmtOption SQLTables

Level 2 API Support


The following ODBC Level 2 API functions are fully or partially supported:
SQLDataSources
SQLDrivers
SQLExtendedFetch
SQLMoreResults
SQLNumParams
SQLParamOptions
SQLPrimaryKeys
SQLSetPos
SQLSetScrollOptions (partial support)
The following Level 2 API functions are not supported:
SQLBrowseConnect
SQLColumnPrivileges
SQLDescribeParam
SQLForeignKeys
SQLNativeSql
SQLProcedureColumns
SQLProcedures
SQLTablePrivileges
SQLAllocConnect (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Allocates memory for a connection handle, hdbc, within the environment identified by henv. The Driver Manager
processes this call and calls the driver's SQLAllocConnect whenever SQLConnect, SQLBrowseConnect, or
SQLDriverConnect is called.
For more information, see SQL AllocConnect in the ODBC Programmer's Reference.
SQLAllocEnv (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Allocates memory for an environment handle, henv,and initializes the ODBC call level interface for use by an
application.
For more information, see SQL AllocEnv in the ODBC Programmer's Reference.
SQLAllocStmt (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Allocates memory for a statement handle and associates the statement handle with the connection specified by
hdbc. The Driver Manager passes this call to the driver, which allocates the memory for the hstmt structure.
For more information, see SQL AllocStmt in the ODBC Programmer's Reference.
SQLBindCol (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Assigns storage space for a result column and specifies the type of the result. When SQLFetch or
SQLExtendedFetch is called, the driver places the data for all bound columns in the assigned locations. See
SQLGetTypeInfo for the mapping between ODBC and Visual FoxPro data types.
For more information, see SQLBindCol in the ODBC Programmer's Reference.
SQLBindParameter (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Associates a buffer with a parameter marker in an SQL statement. The Visual FoxPro ODBC Driver supports input
parameters as specified by the fParamType argument.
For more information, see SQLBindParameter in the ODBC Programmer's Reference.
SQLCancel (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Cancels the processing on a statement handle, hstmt.
For more information, see SQLCancel in the ODBC Programmer's Reference.
SQLColAttributes (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Returns descriptor information for a column in a result set. Descriptor information is returned as a character string,
a 32-bit descriptor-dependent value, or an integer value.

NOTE
SQLColAttributes cannot be used to return information about the bookmark column (column 0).

The Visual FoxPro ODBC Driver supports all fDescType values. The following table includes comments on the
driver's implementation of selected values.

FDESCTYPE COMMENT

SQL_COLUMN_AUTO_INCREMENT Returns FALSE: Visual FoxPro has no counter fields.

SQL_COLUMN_CASE_SENSITIVE Always returns TRUE if the column type is Character.

SQL_COLUMN_LABEL Returns the column name, which is also returned by


SQL_COLUMN_NAME.

SQL_COLUMN_MONEY Returns TRUE if the column type is Currency (represented by a


"Y" in the Visual FoxPro language).

SQL_COLUMN_OWNER_NAME Always returns an empty string.

SQL_COLUMN_QUALIFIER_NAME Always returns an empty string.

SQL_COLUMN_SEARCHABLE Returns SQL_UNSEARCHABLE for columns of type General;


these columns cannot be used in a WHERE clause.

Returns SQL_SEARCHABLE for columns of type Character or


Memo with NOCPTRANS not set; these columns can be used
in a WHERE clause with any comparison operator.

Returns SQL_ALL_EXCEPT_LIKE for all other column types;


these columns can be used in a WHERE clause with all
comparison operators except LIKE.

SQL_COLUMN_TABLE_NAME Always returns an empty string.


For more information, see SQLColAttributes in the ODBC Programmer's Reference.
SQLColumns (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
For a table, creates a result set that is the column list for the specified table or tables.
For more information, see SQLColumns in the ODBC Programmer's Reference.
SQLConnect (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Connects to a data source, which can be either a database or a directory of tables. The Visual FoxPro ODBC Driver
ignores the szUID, cbUID, szAuthStr, and cbAuthStr arguments.
For more information, see SQLConnect in the ODBC Programmer's Reference.
SQLDataSources (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Lists data source names.
For more information, see SQLDataSources in the ODBC Programmer's Reference.
SQLDescribeCol (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Returns the name, type, precision, scale, and nullability of the given result column.
For more information, see SQLDescribeCol in the ODBC Programmer's Reference.
SQLDisconnect (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Closes a connection.
For more information, see SQLDisconnect in the ODBC Programmer's Reference.
SQLDriverConnect (Visual FoxPro ODBC Driver)
4/10/2018 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Connects to an existing data source, which can be either a database or a directory of free tables. The ODBC
attribute keywords UID and PWD are ignored. The following table lists the additional supported attribute
keywords.

ODBC ATTRIBUTE KEYWORD ATTRIBUTE VALUE

DSN

UID Ignored by the Visual FoxPro ODBC Driver but does not
generate an error.

PWD Ignored by the Visual FoxPro ODBC Driver but does not
generate an error.

Driver The name and location of the Visual FoxPro ODBC Driver;
implemented by the Driver Manager.

VISUAL FOXPRO ODBC DRIVER ATTRIBUTE KEYWORD ATTRIBUTE VALUE

BackgroundFetch "Yes" or "No"

Collate "Machine" or other collating sequence. For a list of supported


collating sequences, see SET COLLATE.

Description

Exclusive "Yes" or "No"

SourceDB A fully qualified path to a directory containing zero or more


free tables, or the absolute path and file name for a database.

SourceType "DBC" or "DBF"

Version

If the data source name is not specified, the Driver Manager prompts the user for the information (depending on
the setting of the fDriverCompletion argument) and then continues. If more information is required, the Visual
FoxPro ODBC Driver displays the prompt dialog.
For more information, see SQLDriverConnect in the ODBC Programmer's Reference.
SQLDrivers (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Lists driver descriptions and driver attribute keywords.
For more information, see SQLDrivers in the ODBC Programmer's Reference.
SQLError (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Returns error or status information about the last error. The driver maintains a stack or list of errors that can be
returned for the hstmt, hdbc, and henv arguments, depending on how the call to SQLError is made. The error
queue is flushed after each statement.
The following table describes the SQLError arguments and return values used by the driver.

SQLERROR ARGUMENT RETURN VALUE DESCRIPTION

szSQLState The value for the SQLSTATE represented by the error.

pfNativeError A nonzero value indicates a Visual FoxPro ODBC Driver Native


Error Message. A value of zero indicates the error has been
detected by the driver and mapped to the appropriate ODBC
Error Code.

szErrorMsg The text for the native error or ODBC error.

pcbErrorMsg The length of the message text plus the length of the
identifiers.

For more information on driver error messages, see Error Messages Overview. For more information about this
function, see SQLError in the ODBC Programmer's Reference.
SQLExecDirect (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Executes a new, preparable SQL statement. The Visual FoxPro ODBC Driver uses the current values of the
parameter marker variables if any parameters exist in the statement.
To create a batch command to submit more than one SQL statement at a time, use a semicolon (;) to separate
each SQL statement in the batch.
If your table, view, or field names contain spaces, enclose the names in back quote marks. For example, if your
database contains a table named My Table and the field My Field, enclose each element of the identifier as
follows:

SELECT `My Table`.`Field1`, `My Table`.`Field2` FROM `My Table`

For more information, see SQLExecDirect in the ODBC Programmer's Reference.


SQLExecute (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Executes a prepared SQL statement (a statement already prepared by SQLPrepare). The driver uses the current
values of the parameter marker variables if any parameters exist in the statement.
For more information, see SQLExecute in the ODBC Programmer's Reference.
SQLExtendedFetch (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Similar to SQLFetch but returns multiple rows using an array for each column. The result set is forward-scrollable
and can be made backward-scrollable if the cursor is defined to be static, not forward-only.
By default, the Visual FoxPro ODBC Driver does not return rows marked as deleted in a FoxPro table. Rows
marked for deletion but not yet removed from a table are not included in the result set cursor. You can change this
behavior by using the SET DELETED command.
For more information, see SQLExtendedFetch in the ODBC Programmer's Reference.
SQLFetch (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Retrieves one row from a result set into the locations specified by the previous calls to SQLBindCol. Prepares the
driver for a call to SQLGetData for the unbound columns.
For more information, see SQLFetch in the ODBC Programmer's Reference.
SQLFreeConnect (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Releases a connection handle and frees all memory allocated for the handle.
For more information, see SQLFreeConnect in the ODBC Programmer's Reference.
SQLFreeEnv (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Closes the Visual FoxPro ODBC Driver and releases all memory associated with the driver.
For more information, see SQLFreeEnv in the ODBC Programmer's Reference.
SQLFreeStmt (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Stops processing associated with a specific hstmt, closes any open cursors associated with the hstmt, discards
pending results, and optionally frees all resources associated with the statement handle.
For more information, see SQLFreeStmt in the ODBC Programmer's Reference.
SQLGetConnectOption (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Partial
ODBC API Conformance: Level 1
Returns the current setting of a connection option. This function is partially supported: The driver supports all
values for the fOption argument but does not support some of vParam values for the fOption argument
SQL_TXN_ISOL ATION.
The following table describes only those arguments with behavior specific to the Visual FoxPro ODBC Driver
implementation of SQLGetConnectOption.

FOPTION REMARKS

SQL_AUTOCOMMIT If you choose SQL_AUTOCOMMIT_OFF, your application must


explicitly commit or roll back transactions with SQLTransact;
the Visual FoxPro ODBC Driver does not automatically commit
a transactable statement upon completion. The driver does
begin a transaction if the statement is transactable.

SQL_CURRENT_QUALIFIER Can be a fully qualified database (.dbc file) name or fully


qualified path to a directory containing zero or more tables
(.dbf files).

SQL_LOGINTIMEOUT Returns "Driver Not Capable" error.

SQL_CURSORS Returns "Driver Not Capable" error.

SQL_PACKET_SIZE Returns "Driver Not Capable" error.

SQL_TXN_ISOLATION The driver allows only SQL_TXN_READ_COMMITTED.

The following vParams are not supported:

SQL_TXN_READ_UNCOMMITTED

SQL_TXN_REAPEATABLE_READ

SQL_TXN_SERIALIZABLE

For more information, see SQLGetConnectOption in the ODBC Programmer's Reference.


SQLGetCursorName (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Returns the name of the cursor associated with the given hstmt. SQLGetCursorName is included in the Visual
FoxPro ODBC Driver API because it is a part of Core Level API functionality; it cannot be used with other API
functions because the driver does not support positioned updates.
For more information, see SQLGetCursorName in the ODBC Programmer's Reference.
SQLGetData (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Retrieves the value of a single field in the current record of the given result set.
For more information, see SQLGetData in the ODBC Programmer's Reference.
SQLGetFunctions (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Returns TRUE for all supported functions.
The Visual FoxPro ODBC Driver supports all ODBC API Core and Level 1 functions. The following table indicates
whether the driver supports a specific Level 2 function.

FUNCTION SUPPORTED

SQL_API_SQLBROWSECONNECT No

SQL_API_SQLCOLUMNPRIVELEGES No

SQL_API_SQLDATASOURCES Yes

SQL_API_SQLDESCRIBEPARAM No

SQL_API_SQLDRIVERS Yes

SQL_API_SQLEXTENDEDFETCH Yes

SQL_API_SQLFOREIGNKEYS No

SQL_API_SQLMORERESULTS Yes

SQL_API_SQLNATIVESQL No

SQL_API_SQLNUMPARAMS Yes

SQL_API_SQLPARAMOPTIONS Yes

SQL_API_SQLPRIMARYKEYS Yes

SQL_API_SQLPROCEDURECOLUMNS No

SQL_API_SQLPROCEDURES No

SQL_API_SQLSETPOS Yes
FUNCTION SUPPORTED

SQL_API_SQLSETSCROLLOPTIONS Yes

SQL_API_SQLTABLEPRIVILEGES No

For more information, see SQLGetFunctions in the ODBC Programmer's Reference.


SQLGetInfo (Visual FoxPro ODBC Driver)
12/20/2017 • 4 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Returns general information about the Visual FoxPro ODBC Driver and data source associated with a connection
handle, hdbc. The following list shows the value returned by the Visual FoxPro ODBC Driver for each fInfoType
argument and comments regarding the returned values.
For more information, see SQLGetInfo in the ODBC Programmer's Reference.

A
SQL_ACCESSIBLE_PROCEDURES returns 'N'.
SQL_ACCESSIBLE_TABLES returns 'Y'.
SQL_ACTIVE_CONNECTIONS returns 0.
SQL_ACTIVE_STATEMENTS returns 0.
SQL_ALTER_TABLE returns either SQL_AT_ADD_COLUMN or SQL_AT_DROP_COLUMN.

B
SQL_BOOKMARK_PERSISTENCE returns SQL_BP_SCROLL.

C
SQL_COLUMN_ALIAS returns 'Y'.
SQL_CONCAT_NULL_BEHAVIOR returns SQL_CB_NULL.
SQL_CONVERT_BIGINT returns 0. The Visual FoxPro ODBC Driver does not support BigInt.
SQL_CONVERT_BINARY returns 0.
SQL_CONVERT_BIT returns 0.
SQL_CONVERT_CHAR returns 0.
SQL_CONVERT_DATE returns 0.
SQL_CONVERT_DECIMAL returns 0.
SQL_CONVERT_DOUBLE returns 0.
SQL_CONVERT_FLOAT returns 0.
SQL_CONVERT_INTEGER returns 0.
SQL_CONVERT_LONGVARBINARY returns 0.
SQL_CONVERT_LONGVARCHAR returns 0.
SQL_CONVERT_NUMERIC returns 0.
SQL_CONVERT_REAL returns 0.
SQL_CONVERT_SMALLINT returns 0.
SQL_CONVERT_TIME returns 0.
SQL_CONVERT_TIMESTAMP returns 0.
SQL_CONVERT_TINYINT returns 0.
SQL_CONVERT_VARBINARY returns 0.
SQL_CONVERT_VARCHAR returns 0.
SQL_CONVERT_FUNCTIONS returns 0.
SQL_CORREL ATION_NAME returns SQL_CN_ANY.
SQL_CURSOR_COMMIT_BEHAVIOR returns SQL_CB_PRESERVE.
SQL_CURSOR_ROLLBACK_BEHAVIOR returns SQL_CB_PRESERVE.

D
SQL_DATA_SOURCE_NAME returns the value passed as DSN to SQLConnect, or SQLDriverConnect; returns an
empty string if no DSN is specified.
SQL_DATA_SOURCE_READ_ONLY returns 'N'.
SQL_DATABASE_NAME returns a full UNC path to the current database if the data source is a database. If the
data source connects to a directory of tables, the function returns the path to the directory.
SQL_DBMS_NAME returns "Visual FoxPro".
SQL_DBMS_VER returns "03.00.0000".
SQL_DEFAULT_TXN_ISOL ATION returns SQL_TXN_READ_COMMITTED. Dirty reads are not possible, but
nonrepeatable reads and phantoms are possible.
SQL_DRIVER_HDBC is implemented by the Driver Manager.
SQL_DRIVER_HENV is implemented by the Driver Manager.
SQL_DRIVER_HLIB is implemented by the Driver Manager.
SQL_DRIVER_HSTMT is implemented by the Driver Manager.
SQL_DRIVER_NAME returns "vfpodbc.dll".
SQL_DRIVER_ODBC_VER returns "02.50" (SQL_SPEC_MAJOR, SQL_SPEC_MINOR ).
SQL_DRIVER_VER returns "01.00.0000".

E
SQL_EXPRESSIONS_IN_ORDERBY returns 'N'.
F
SQL_FETCH_DIRECTION returns:
SQL_FD_FETCH_NEXT
SQL_FD_FETCH_FIRST
SQL_FD_FETCH_L AST
SQL_FD_FETCH_PRIOR
SQL_FD_FETCH_ABSOLUTE
SQL_FD_FETCH_REL ATIVE
SQL_FD_FETCH_BOOKMARK.
SQL_FILE_USAGE returns SQL_FILE_QUALIFIER both for database (.dbc file) and for free table (.dbf file)
data sources.

G-H
SQL_GETDATA_EXENSIONS returns:
SQL_GD_ANY_COLUMN
SQL_GD_ANY_BLOCK
SQL_GD_ANY_BOUND
SQL_GD_ANY_ORDER
SQL_GROUP_BY returns SQL_GB_NO_REL ATION.

I-J
SQL_IDENTIFIER_CASE returns SQL_IC_MIXED.
SQL_IDENTIFIER_QUOTE_CHAR returns `.

K
SQL_KEYWORDS returns "".

L
SQL_LIKE_ESCAPE_CL AUSE returns 'N'.
SQL_LOCK_TYPES returns SQL_LCK_NO_CHANGE.

M
SQL_MAX_BINARY_LITERAL_LEN returns 0.
SQL_MAX_CHAR_LITERAL_LEN returns 254.
SQL_MAX_COLUMN_NAME_LEN returns 128.
SQL_MAX_COLUMNS_IN_GROUP_BY returns 16.
SQL_MAX_COLUMNS_IN_ORDER_BY returns 16.
SQL_MAX_COLUMNS_IN_INDEX returns 0.
SQL_MAX_COLUMNS_IN_SELECT returns 254.
SQL_MAX_COLUMNS_IN_TABLE returns 254.
SQL_MAX_CURSOR_NAME_LEN returns 254.
SQL_MAX_INDEX_SIZE returns 0.
SQL_MAX_OWNER_NAME_LEN returns 0.
SQL_MAX_PROCEDURE_NAME_LEN returns 0. The Visual FoxPro ODBC Driver does not allow direct access to
Visual FoxPro stored procedures.
SQL_MAX_QUALIFIER_NAME_LEN returns the maximum operating system path length.
SQL_MAX_ROW_SIZE returns 254^2.
SQL_MAX_ROW_SIZE_INCLUDES_LONG returns 'N'.
SQL_MAX_STATEMENT_LEN returns 8192.
SQL_MAX_TABLE_NAME_LEN returns 128.
SQL_MAX_TABLES_IN_SELECT returns 16.
SQL_MAX_USER_NAME_LEN returns 0.
SQL_MULT_RESULT_SETS returns 'Y'.
SQL_MULTIPLE_ACTIVE_TXN returns 'Y'. Multiple connections can have several transactions open at once.

N
SQL_NEED_LONG_DATA_LEN returns 'N'.
SQL_NON_NULL ABLE_COLUMNS returns SQL_NNC_NON_NULL.
SQL_NULL_COLL ATION returns SQL_NC_LOW.
SQL_NUMERIC_FUNCTIONS returns all functions except SQL_FN_NUM_POWER, which is not supported by
the Visual FoxPro ODBC Driver. The following functions are supported:
SQL_FN_NUM_ABS
SQL_FN_NUM_ACOS
SQL_FN_NUM_ASIN
SQL_FN_NUM_ATAN
SQL_FN_NUM_ATAN2
SQL_FN_NUM_CELING
SQL_FN_NUM_COS
SQL_FN_NUM_COT
SQL_FN_NUM_DEGREES
SQL_FN_NUM_EXP
SQL_FN_NUM_FLOOR
SQL_FN_NUM_LOG
SQL_FN_NUM_LOG10
SQL_FN_NUM_MOD
SQL_FN_NUM_PI
SQL_FN_NUM_RADIANS
SQL_FN_NUM_RAND
SQL_FN_NUM_ROUND
SQL_FN_NUM_SIGN
SQL_FN_NUM_SIN
SQL_FN_NUM_SQRT
SQL_FN_NUM_TAN

O
SQL_ODBC_API_CONFORMANCE returns SQL_OAC_LEVEL1.
SQL_ODBC_SAG_CLI_CONFORMANCE returns SQL_OSCC_COMPLIANT.
SQL_ODBC_SQL_CONFORMANCE returns SQL_OSC_MINIMUM. Minimum SQL syntax is supported.
SQL_ODBC_SQL_OPT_IEF returns "N".
SQL_ODBC_VER is implemented by the Driver Manager.
SQL_ORDER_BY_COLUMNS_IN_SELECT returns "N".
SQL_OUTER_JOINS returns "N".
SQL_OWNER_TERM returns "". The Visual FoxPro ODBC Driver does not support owners for its objects.
SQL_OWNER_USAGE returns 0. The Visual FoxPro ODBC Driver does not support owners for its objects.

P
SQL_POS_OPERATIONS returns SQL_POS_POSITION.
SQL_POSITIONED_STATEMENTS returns 0.
SQL_PROCEDURE_TERM returns "".
SQL_PROCEDURES returns 'N'.

Q
SQL_QUALIFIER_LOCATION returns SQL_QL_START.
SQL_QUALIFIER_NAME_SEPARATOR returns '!' or '\'. The separator between database and table is '!' for data
sources connected to databases, and '\' for data sources that are directories of free tables.
SQL_QUALIFIER_TERM returns "database" or "directory". The qualifier is "database" for data sources connected
to databases, and "directory" for data sources that are directories of free tables.
SQL_QUALIFIER_USAGE does not support SQL_QU_PRIVILEGE_DEFINITION; it returns either
SQL_QU_DML_STATEMENT or SQL_QU_TABLE_DEFINITION.
SQL_QUOTED_IDENTIFIER_CASE returns SQL_IC_MIXED.

R
SQL_ROW_UPDATES returns "N". The Visual FoxPro ODBC Driver supports only static and forward cursors.

S
SQL_SCROLL_CONCURRENCY returns SQL_SCCO_READ_ONLY.
SQL_SCROLL_OPTIONS returns either SQL_SO_STATIC or SQL_SO_READONLY.
SQL_SEARCH_PATTERN_ESCAPE returns "\".
SQL_SERVER_NAME returns "".
SQL_SPECIAL_CHARACTERS returns "~@#$%^".
SQL_STATIC_SENSITIVITY returns 0. The Visual FoxPro ODBC Driver does not support positional updates.
SQL_STRING_FUNCTIONS does not support SQL_FN_STR_INSERT, SQL_FN_STR_LOCATE,
SQL_FN_STR_LOCATE_2, or SQL_FN_STR_SOUNDEX.
It returns:
SQL_FN_STR_ASCII
SQL_FN_STR_CHAR
SQL_FN_STR_CONCAT
SQL_FN_STR_DIFFERENCE
SQL_FN_STR_LCASE
SQL_FN_STR_LEFT
SQL_FN_STR_LENGTH
SQL_FN_STR_LTRIM
SQL_FN_STR_REPEAT
SQL_FN_STR_REPL ACE
SQL_FN_STR_RIGHT
SQL_FN_STR_RTRIM
SQL_FN_STR_SUBSTRING
SQL_FN_STR_UCASE
SQL_FN_STR_SPACE.
SQL_SUBQUERIES returns:
SQL_SQ_CORREL ATED_SUBQUERIES
SQL_SQ_COMPARISON
SQL_SQ_EXISTS
SQL_SQ_IN
SQL_SQ_QUANTIFIED.
SQL_SYSTEM_FUNCTIONS returns:
SQL_FN_SYS_DBNAME
SQL_FN_SYS_IFNULL
but not:
SQL_FN_SYS_USERNAME

T
SQL_TABLE_TERM returns "table".
SQL_TIMEDATE_ADD_INTERVALS returns:
SQL_FN_TSI_ SECOND
SQL_FN_TSI_MINUTE
SQL_FN_TSI_HOUR
SQL_FN_TSI_DAY
SQL_FN_TSI_MONTH
SQL_FN_TSI_YEAR
but not:
SQL_FN_TSI_FRAC_SECOND
SQL_FN_TSI_WEEK
SQL_FN_TSI_QUARTER
SQL_TIMEDATE_DIFF_INTERVALS returns:
SQL_FN_TSI_ SECOND
SQL_FN_TSI_MINUTE
SQL_FN_TSI_HOUR
SQL_FN_TSI_DAY
SQL_FN_TSI_MONTH
SQL_FN_TSI_YEAR
SQL_TIMEDATE_FUNCTIONS does not support SQL_FN_TD_QUARTER, SQL_FN_TD_TIMESTAMPADD,
SQL_FN_TD_DAYOFYEAR, or SQL_FN_TD_WEEK.
It returns:
SQL_FN_TD_CURDATE
SQL_FN_TD_CURTIME
SQL_FN_TD_DAYNAME
SQL_FN_TD_DAYOFMONTH
SQL_FN_TD_DAYOFWEEK
SQL_FN_TD_HOUR
SQL_FN_TD_MINUTE
SQL_FN_TD_MONTH
SQL_FN_TD_MONTHNAME
SQL_FN_TD_NOW
SQL_FN_TD_SECOND
SQL_FN_TD_TIMESTAMPDIFF
SQL_FN_TD_YEAR .
SQL_TXN_CAPABLE returns SQL_TC_DML.
SQL_TXN_ISOL ATION_OPTION returns SQL_TXN_READ_COMMITTED.

U-Z
SQL_UNION returns either SQL_U_UNION or SQL_U_UNION_ALL.
SQL_USER_NAME returns <blank>.
SQLGetStmtOption (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level One
Returns the current setting of a statement option.

FOPTION RETURNS

SQL_GET_BOOKMARK 32-bit integer value that is the bookmark for the current
record number

SQL_ROW_NUMBER 32-bit integer specifying the position of the current row within
the result set

SQL_TRANSLATE_DLL Error: "Driver not capable"

The Visual FoxPro ODBC Driver has no translation DLLs.


For more information, see SQLGetStmtOption in the ODBC Programmer's Reference.
SQLGetTypeInfo (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Returns information about the data types supported by a data source. The driver returns the information in an
SQL result set. The following table lists ODBC data types and the corresponding Visual FoxPro data type.

ODBC TYPE VISUAL FOXPRO TYPE

SQL_BIGINT Not supported. There is no 64-bit Visual FoxPro type.

SQL_BIT Logical

SQL_CHAR Character

SQL_DATE Date

SQL_DECIMAL Numeric

SQL_DOUBLE Double

SQL_FLOAT Double

SQL_INTEGER Integer

SQL_LONGVARBINARY Memo (Binary)

SQL_LONGVARCHAR Memo

SQL_NUMERIC Numeric*, Currency, Float

SQL_REAL Double

SQL_SMALLINT Integer

SQL_TIME Not supported. There is no Visual FoxPro time type.

SQL_TIMESTAMP DateTime

SQL_TINYINT Integer
ODBC TYPE VISUAL FOXPRO TYPE

SQL_VARBINARY Memo (Binary)*, General

SQL_VARCHAR Character

*Default type
For more information about Visual FoxPro data types, see CREATE TABLE. For more information about this
function, see SQLGetTypeInfo in the ODBC Programmer's Reference.
SQLMoreResults (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Determines whether more results are pending on a statement handle, hstmt, containing SELECT, UPDATE,
INSERT, or DELETE statements and if so, initializes processing for those results.
For more information, see SQLMoreResults in the ODBC Programmer's Reference.
SQLNumParams (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Returns the number of parameters in an SQL statement. The number of parameters should equal the number of
question marks in the SQL statement passed to SQLPrepare.
For more information about SQL grammar, see Supported ODBC SQL Grammar. For more information about
this function, see SQLNumParams in the ODBC Programmer's Reference.
SQLNumResultCols (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Returns the number of columns in a result set cursor.
For more information, see SQLNumResultCols in the ODBC Programmer's Reference.
SQLParamData (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Used in conjunction with SQLPutData to specify parameter data at statement execution time.
For more information, see SQLParamData in the ODBC Programmer's Reference.
SQLParamOptions (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Allows an application to specify multiple values for the set of parameters assigned by SQLBindParameter. The
ability to specify multiple values for a set of parameters is useful for bulk inserts and other work that requires the
data source to process the same SQL statement multiple times with various parameter values. For example, an
application can specify three sets of values for the set of parameters associated with an INSERT statement and
then execute the INSERT statement once to perform the three insert operations.
For more information, see SQLParamOptions in the ODBC Programmer's Reference.
SQLPrepare (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Prepares an SQL statement by planning how to optimize and execute the statement. The SQL statement is
compiled for execution by SQLExecDirect.
If your table, view, or field names contain spaces, enclose the names in back quote (`) marks. For example, if your
database contains a table named My Table and the field My Field, enclose each element of the identifier as
follows:

SELECT * FROM `My Table`.`My Field`

For more information, see SQLPrepare in the ODBC Programmer's Reference.


SQLPrimaryKeys (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Returns the column names that comprise the primary key for a table. The Visual FoxPro ODBC Driver
implementation of SQLPrimaryKeys behaves as follows:
Ignores the szTableOwner and cbTableOwner arguments.
Works only for data sources that are databases. The driver returns the error "Driver does not support this
function" if the data source is a directory of free tables.
For more information, see SQLPrimaryKeys in the ODBC Programmer's Reference.
SQLPutData (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Allows an application to send data for a parameter or column to the driver at statement execution time.
For more information, see SQLPutData in the ODBC Programmer's Reference.
SQL Row Count (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Returns the number of rows affected by the last UPDATE, INSERT, or DELETE statement.
For more information, see SQLRowCount in the ODBC Programmer's Reference.
SQLSetConnectOption (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Partial
ODBC API Conformance: Level 1
Sets options that govern aspects of connections. This function is partially supported: The driver supports all values
for the fOption argument but does not support some of vParam values for the fOption argument
SQL_TXN_ISOL ATION.
The following table describes only those arguments with behavior specific to the Visual FoxPro ODBC Driver
implementation of SQLSetConnectOption.

FOPTION REMARKS

SQL_AUTOCOMMIT If you choose SQL_AUTOCOMMIT_OFF, your application must


explicitly commit or roll back transactions with SQLTransact;
the Visual FoxPro ODBC Driver does not automatically commit
a transactable statement upon completion. The driver does
begin a transaction if the statement is transactable.

SQL_CURRENT_QUALIFIER Can be a fully qualified database name or fully qualified path


to a directory containing zero or more free tables.

SQL_LOGINTIMEOUT Returns "Driver not capable" error.

SQL_CURSORS Returns "Driver not capable" error.

SQL_PACKET_SIZE Returns "Driver not capable" error.

SQL_TXN_ISOLATION The driver allows only SQL_TXN_READ_COMMITTED.

The following vParams are not supported:

SQL_TXN_READ_UNCOMMITTED

SQL_TXN_REAPEATABLE_READ

SQL_TXN_SERIALIZABLE

For more information, see SQLSetConnectOption in the ODBC Programmer's Reference.


SQLSetCursorName (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Associates a cursor name with an active statement handle, hstmt. SQLSetCursorName is included in the Visual
FoxPro ODBC Driver API because it is a part of Core Level ODBC API functionality; it cannot be used with other
API functions because the driver does not support positioned updates.
For more information, see SQLSetCursorName in the ODBC Programmer's Reference.
SQLSetPos (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 2
Sets the cursor position in a rowset. You can use SQLSetPos with SQLGetData to retrieve rows from unbound
columns after positioning the cursor to a specific row in the rowset.
For more information, see SQLSetPos in the ODBC Programmer's Reference.
SQLSetScrollOptions (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Partial
ODBC API Conformance: Level 2
Sets options that control the behavior of cursors associated with a statement handle, hstmt.
The Visual FoxPro ODBC Driver supports only SQL_CONCUR_READ_ONLY; it does not support the
fConcurrency value SQL_CONCUR_ROWVER. The driver converts SQL_KEYSET_SIZE,
SQL_CURSOR_DYNAMIC, and SQL_CURSOR_KEYSET_DRIVEN to SQL_SCROLL_STATIC with warning
ODBC_01S02.
For more information, see SQLSetScrollOptions in the ODBC Programmer's Reference.
SQLSetStmtOption (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Sets options related to a statement handle, hstmt.

FOPTION ALLOWED VALUES COMMENTS

SQL_ASYNC_ENABLE SQL_ASYNC_ENABLE_OFF If you attempt to set this fOption, the


driver returns the error: "Driver not
capable". Visual FoxPro does not
support asynchronous execution.

SQL_BIND_TYPE SQL_BIND_BY_COLUMN or a 32-bit


value denoting the length of the
structure or an instance of a buffer into
which result columns will be bound.

SQL_CONCURRENCY SQL_CONCUR_READ_ONLY The driver doesn't allow


SQL_CONCUR_ROWVER, because
SQL_CONCUR_LOCK Visual FoxPro does not have row
versioning based on timestamps.
SQL_CONCUR_VALUES

SQL_CURSOR_TYPE SQL_CURSOR_FORWARD_ONLY The driver does not allow


SQL_CURSOR_KEYSET_DRIVEN or
SQL_CURSOR_STATIC SQL_CURSOR_DYNAMIC; see
SQLSetScrollOptions for more
information.

SQL_KEYSET_SIZE Error: "Driver not capable" Visual FoxPro does not support the
keyset cursor model.

SQL_MAX_LENGTH 0 If you attempt to set this fOption value,


the driver returns the error "Driver not
capable".

SQL_MAX_ROWS 0 If you attempt to set this fOption value,


the driver returns the error "Driver not
capable".

SQL_NOSCAN SQL_NOSCAN_OFF
FOPTION ALLOWED VALUES COMMENTS

SQL_QUERY_TIMEOUT 0 If you attempt to set this fOption value,


the driver returns the error "Driver not
capable".

SQL_RETRIEVE_DATA SQL_RD_ON, SQL_RD_OFF

SQL_ROWSET_SIZE 1 to 4,294,967,296

SQL_SIMULATE_CURSOR Error: "Driver not capable"

SQL_USE_BOOKMARKS SQL_UB_OFF

SQL_UB_ON

For more information, see SQLSetStmtOption in the ODBC Programmer's Reference.


SQLSpecialColumns (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Retrieves the optimal set of columns that uniquely identifies a row in the table.
The Visual FoxPro ODBC Driver returns the columns that make up the primary key on the FoxPro table. (See
SQLPrimaryKeys.) If called with fColType set to SQL_ROWVER, no columns are returned. SQLSpecialColumns
works only for data sources that are databases.
For more information, see SQLSpecialColumns in the ODBC Programmer's Reference.
SQLStatistics (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Retrieves a list of statistics about a single table and the indexes, or tag names, associated with the table. The driver
returns the information as a result set.
For more information, see SQLStatistics in the ODBC Programmer's Reference.
SQLTables (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Level 1
Returns the list of table names specified by the parameter in the SQLTables statement. If no parameter is
specified, returns the table names stored in the current data source. The driver returns the information as a result
set.
Enumeration type calls will not receive a result set entry for remote views or local parameterized views. However,
a call to SQLTables with a unique table name specifier will find a match for such a view if present with that name;
this allows the API to be used to check for name conflicts prior to creation of a new table.

NOTE
The Visual FoxPro ODBC driver differentiates between database tables and free tables, even when both types of tables are
stored in the same directory on your system. If your data source is a directory of free tables, the Visual FoxPro ODBC Driver
does not catalog or return the names of any tables that are associated with a database.

For more information, see SQLTables in the ODBC Programmer's Reference.


SQLTransact (Visual FoxPro ODBC Driver)
12/20/2017 • 1 min to read • Edit Online

NOTE
This topic contains Visual FoxPro ODBC Driver-specific information. For general information about this function, see the
appropriate topic under ODBC API Reference.

Support: Full
ODBC API Conformance: Core Level
Requests a commit or rollback operation for all active operations on all statement handles (hstmts) associated with
a connection or for all connections associated with the environment handle, henv. SQLTransact works only for
data sources that are databases.
If a commit fails when in manual mode, the transaction remains active; you can choose to roll back the transaction
or retry the commit operation. If a commit operation fails when in automatic transaction mode, the transaction is
rolled back automatically; the transaction cannot be inactive.
For more information, see SQLTransact in the ODBC Programmer's Reference.
Visual FoxPro Language Reference
12/20/2017 • 1 min to read • Edit Online

This section contains the following topics.


ALTER TABLE - SQL Command
CREATE TABLE - SQL Command
DELETE - SQL Command
DELETE TAG Command
DROP TABLE Command
INDEX Command
INSERT - SQL Command
SELECT - SQL Command
SET ANSI Command
SET BLOCKSIZE Command
SET COLL ATE Command
SET DELETED Command
SET EXACT Command
SET EXCLUSIVE Command
SET NULL Command
SET PATH Command
SET REPROCESS Command
SET UNIQUE Command
UPDATE - SQL Command
Visual FoxPro Field Data Types
ALTER TABLE - SQL Command
12/20/2017 • 8 min to read • Edit Online

Programmatically modifies the structure of a table.

Syntax
ALTER TABLE TableName1
ADD | ALTER [COLUMN] FieldName1
FieldType [(nFieldWidth [, nPrecision])]
[NULL | NOT NULL]
[CHECK lExpression1 [ERROR cMessageText1]]
[DEFAULT eExpression1]
[PRIMARY KEY | UNIQUE]
[REFERENCES TableName2 [TAG TagName1]]
[NOCPTRANS]
- Or -
ALTER TABLE TableName1
ALTER [COLUMN] FieldName2
[NULL | NOT NULL]
[SET DEFAULT eExpression2]
[SET CHECK lExpression2 [ERROR cMessageText2]]
[DROP DEFAULT]
[DROP CHECK]
- Or -
ALTER TABLE TableName1
[DROP [COLUMN] FieldName3]
[SET CHECK lExpression3 [ERROR cMessageText3]]
[DROP CHECK]
[ADD PRIMARY KEY eExpression3 TAG TagName2]
[DROP PRIMARY KEY]
[ADD UNIQUE eExpression4 [TAG TagName3]]
[DROP UNIQUE TAG TagName4]
[ADD FOREIGN KEY [eExpression5] TAG TagName4
REFERENCES TableName2 [TAG TagName5]]
[DROP FOREIGN KEY TAG TagName6 [SAVE]]
[RENAME COLUMN FieldName4 TO FieldName5]
[NOVALIDATE]

Arguments
TableName1
Specifies the name of the table whose structure is modified.
ADD [COLUMN ] FieldName1
Specifies the name of the field to add.
ALTER [COLUMN ] FieldName1
Specifies the name of an existing field to modify.
FieldType [( nFieldWidth [, nPrecision]])
Specifies the field type, field width, and field precision (number of decimal places) for a new or modified field.
FieldType is a single letter that indicates the field's data type. Some field data types require that you specify
nFieldWidth or nPrecision or both.
nFieldWidth and nPrecision are ignored for D, G, I, L, M, P, T, and Y types. By default, nPrecision is zero (no decimal
places) if nPrecision is not included for the B, F, or N types.
NULL | NOT NULL
Allows or prevents null values in the field.
If you omit NULL and NOT NULL, the current setting of SET NULL determines whether null values are allowed in
the field. However, if you omit NULL and NOT NULL and include the PRIMARY KEY or UNIQUE clause, the
current setting of SET NULL is ignored and the field is NOT NULL by default.
CHECK lExpression1
Specifies a validation rule for the field. lExpression1 must evaluate to a logical expression and can be a user-
defined function or a stored procedure. Whenever a blank record is appended, the validation rule is checked. An
error is generated if the validation rule does not allow for a blank field value in an appended record.
ERROR cMessageText1
Specifies the error message displayed when the field validation rule generates an error.
DEFAULT eExpression1
Specifies a default value for the field. The data type of eExpression1 must be the same as the data type for the field.
PRIMARY KEY
Creates a primary index tag. The index tag has the same name as the field.
UNIQUE
Creates a candidate index tag with the same name as the field.

NOTE
Candidate indexes (created by including the UNIQUE option, provided for ANSI compatibility in ALTER TABLE or CREATE
TABLE) differ from indexes created by using the UNIQUE option in the INDEX command. An index created by using UNIQUE
in the INDEX command allows duplicate index keys; candidate indexes do not allow duplicate index keys.

Null values and duplicate records are not permitted in a field that is used for a primary or candidate index.
If you are creating a new field by using ADD COLUMN, Visual FoxPro will not generate an error if you create a
primary or candidate index for a field that supports null values. However, Visual FoxPro will generate an error if
you try to enter a null or duplicate value into a field that is used for a primary or candidate index.
If you are modifying an existing field and the primary or candidate index expression consists of fields in the table,
Visual FoxPro checks the fields to see whether they contain null values or duplicate records. If they do, Visual
FoxPro generates an error and the table is not altered.
REFERENCES TableName2 TAG TagName1
Specifies the parent table to which a persistent relationship is established. TAG TagName1 specifies the parent
table's index tag on which the relationship is based. Index tag names can contain up to 10 characters.
NOCPTRANS
Prevents translation to a different code page for character and memo fields. If the table is converted to another
code page, the fields for which NOCPTRANS has been specified are not translated. NOCPTRANS can be
specified only for character and memo fields.
The following example creates a table named mytable that contains two character fields and two memo fields. The
second character field, char2, and the second memo field, memo2, include NOCPTRANS to prevent translation.
CREATE TABLE mytable (char1 C(10), char2 C(10) NOCPTRANS,;
memo1 M, memo2 M NOCPTRANS)

ALTER [COLUMN ] FieldName2


Specifies the name of an existing field to modify.
SET DEFAULT eExpression2
Specifies a new default value for an existing field. The data type of eExpression2 must be the same as the data type
for the field.
SET CHECK lExpression2
Specifies a new validation rule for an existing field. lExpression2 must evaluate to a logical expression and may be
a user-defined function or a stored procedure.
ERROR cMessageText2
Specifies the error message displayed when the field validation rule generates an error. The message is displayed
only when data is changed within a Browse or Edit window.
DROP DEFAULT
Removes the default value for an existing field.
DROP CHECK
Removes the validation rule for an existing field.
DROP [COLUMN ] FieldName3
Specifies a field to remove from the table. Removing a field from the table also removes the field's default value
setting and field validation rule.
If index key or trigger expressions reference the field, the expressions become invalid when the field is removed. In
this case, an error is not generated when the field is removed but the invalid index key or trigger expressions will
generate errors at run time.
SET CHECK lExpression3
Specifies the table validation rule. lExpression3 must evaluate to a logical expression and may be a user-defined
function or a stored procedure.
ERROR cMessageText3
Specifies the error message displayed when the table validation rule generates an error. The message is displayed
only when data is changed within a Browse or Edit window.
DROP CHECK
Removes the table's validation rule.
ADD PRIMARY KEY eExpression3TAG TagName2
Adds a primary index to the table. eExpression3 specifies the primary index key expression, and TagName2
specifies the name of the primary index tag. Index tag names can contain up to 10 characters. If TAG TagName2 is
omitted and eExpression3 is a single field, the primary index tag has the same name as the field specified in
eExpression3.
DROP PRIMARY KEY
Removes the primary index and its index tag. Because a table can have only one primary key, it is not necessary to
specify the name of the primary key. Removing the primary index also deletes any persistent relations based on
the primary key.
ADD UNIQUE eExpression4[TAG TagName3]
Adds a candidate index to the table. eExpression4 specifies the candidate index key expression, and TagName3
specifies the name of the candidate index tag. Index tag names can contain up to 10 characters. If you omit TAG
TagName3 and if eExpression4 is a single field, the candidate index tag has the same name as the field specified in
eExpression4.
DROP UNIQUE TAG TagName4
Removes the candidate index and its index tag. Because a table can have multiple candidate keys, you must specify
the name of the candidate index tag.
ADD FOREIGN KEY [ eExpression5]TAG TagName4
Adds a foreign (nonprimary) index to the table. eExpression5 specifies the foreign index key expression, and
TagName4 specifies the name of the foreign index tag. Index tag names can contain up to 10 characters.
REFERENCES TableName2[TAG TagName5]
Specifies the parent table to which a persistent relationship is established. Include TAG TagName5 to establish a
relation based on an existing index tag for the parent table. Index tag names can contain up to 10 characters. If you
omit TAG TagName5, the relationship is established using the parent table's primary index tag.
DROP FOREIGN KEY TAG TagName6[SAVE ]
Deletes a foreign key whose index tag is TagName6. If you omit SAVE, the index tag is deleted from the structural
index. Include SAVE to prevent deletion of the index tag from the structural index.
RENAME COLUMN FieldName4TO FieldName5
Allows you to change the name of a field in the table. FieldName4 specifies the name of the field that is renamed.
FieldName5 specifies the new name of the field.
Cau t i on

Exercise care when renaming table fields because index expressions, field and table validation rules, commands,
and functions may reference the original field names.
NOVALIDATE
Specifies that Visual FoxPro allows changes to be made to the structure of the table; these changes might violate
the integrity of the data in the table. By default, Visual FoxPro prevents ALTER TABLE from making changes that
violate the integrity of the data in the table. Include NOVALIDATE to override this default behavior.

Remarks
ALTER TABLE can be used to modify the structure of a table that has not been added to a database. However,
Visual FoxPro generates an error if you include the DEFAULT, FOREIGN KEY, PRIMARY KEY, REFERENCES, or
SET clauses when modifying a free table.
ALTER TABLE may rebuild the table by creating a new table header and appending records to the table header.
For example, changing a field's type or width might cause the table to be rebuilt.
After a table is rebuilt, field validation rules are executed for any fields whose type or width is changed. If you
change the type or width of any field in the table, the table rule is executed.
If you modify field or table validation rules for a table that has records, Visual FoxPro tests the new field or table
validation rules against the existing data and issues a warning on the first occurrence of a field or table validation
rule or of a trigger violation.
If the table you modify is in a database, ALTER TABLE - SQL requires exclusive use of the database. To open a
database for exclusive use, include EXCLUSIVE in OPEN DATABASE.

See Also
CREATE TABLE - SQL Command
INDEX Command
CREATE TABLE - SQL Command
12/20/2017 • 7 min to read • Edit Online

Creates a table having the specified fields.


The Visual FoxPro ODBC Driver supports the native Visual FoxPro language syntax for this command. For
driver-specific information, see Driver Remarks.

Syntax
CREATE TABLE | DBF TableName1 [NAME LongTableName] [FREE]
(FieldName1FieldType [(nFieldWidth [, nPrecision])]
[NULL | NOT NULL]
[CHECK lExpression1 [ERROR cMessageText1]]
[DEFAULT eExpression1]
[PRIMARY KEY | UNIQUE]
[REFERENCES TableName2 [TAG TagName1]]
[NOCPTRANS]
[, FieldName2 ...]
[, PRIMARY KEY eExpression2 TAG TagName2
|, UNIQUE eExpression3 TAG TagName3]
[, FOREIGN KEY eExpression4 TAG TagName4 [NODUP]
REFERENCES TableName3 [TAG TagName5]]
[, CHECK lExpression2 [ERROR cMessageText2]])
| FROM ARRAY ArrayName

Arguments
CREATE TABLE | DBF TableName1
Specifies the name of the table to create. The TABLE and DBF options are identical.
NAME LongTableName
Specifies a long name for the table. A long table name can be specified only when a database is open, because
long table names are stored in databases.
Long names can contain up to 128 characters and can be used in place of short file names in the database.
FREE
Specifies that the table will not be added to an open database. FREE isn't required if a database isn't open.
(FieldName1 FieldType [( nFieldWidth [, nPrecision])]
Specifies the field name, field type, field width, and field precision (number of decimal places), respectively.
FieldType is a single letter indicating the field's data type. Some field data types require that you specify
nFieldWidth or nPrecision or both.
nFieldWidth and nPrecision are ignored for D, G, I, L, M, P, T, and Y types. nPrecision defaults to zero (no decimal
places) if nPrecision isn't included for the B, F, or N types.
NULL
Allows null values in the field.
NOT NULL
Prevents null values in the field.
If you omit NULL and NOT NULL, the current setting of SET NULL determines whether null values are allowed
in the field. However, if you omit NULL and NOT NULL and include the PRIMARY KEY or UNIQUE clause, the
current setting of SET NULL is ignored and the field defaults to NOT NULL.
CHECK lExpression1
Specifies a validation rule for the field. lExpression1 can be a user-defined function. Whenever a blank record is
appended, the validation rule is checked. An error is generated if the validation rule doesn't allow for a blank field
value in an appended record.
ERROR cMessageText1
Specifies the error message Visual FoxPro displays when the field rule generates an error. The message is
displayed only when data is changed within a Browse window or an Edit window.
DEFAULT eExpression1
Specifies a default value for the field. The data type of eExpression1 must be the same as the field's data type.
PRIMARY KEY
Creates a primary index for the field. The primary index tag has the same name as the field.
UNIQUE
Creates a candidate index for the field. The candidate index tag has the same name as the field.

NOTE
Candidate indexes (created by including the UNIQUE option in CREATE TABLE or ALTER TABLE - SQL) are not the same as
indexes created with the UNIQUE option in the INDEX command. An index created with the UNIQUE option in the INDEX
command allows duplicate index keys; candidate indexes do not allow duplicate index keys. See INDEX for additional
information on its UNIQUE option.

Null values and duplicate records are not permitted in a field used for a primary or candidate index. However,
Visual FoxPro will not generate an error if you create a primary or candidate index for a field that supports null
values. Visual FoxPro will generate an error if you attempt to enter a null or duplicate value into a field used for a
primary or candidate index.
REFERENCES TableName2[TAG TagName1]
Specifies the parent table to which a persistent relationship is established. If you omit TAG TagName1, the
relationship is established using the primary index key of the parent table. If the parent table does not have a
primary index, Visual FoxPro generates an error.
Include TAG TagName1 to establish a relation based on an existing index tag for the parent table. Index tag
names can contain up to 10 characters.
The parent table cannot be a free table.
NOCPTRANS
Prevents translation to a different code page for character and memo fields. If the table is converted to another
code page, the fields for which NOCPTRANS has been specified are not translated. NOCPTRANS can be
specified only for character and memo fields.
The following example creates a table named mytable containing two character fields and two memo fields. The
second character field, char2, and the second memo field, memo2, include NOCPTRANS to prevent translation.

CREATE TABLE mytable (char1 C(10), char2 C(10) NOCPTRANS,;


memo1 M, memo2 M NOCPTRANS)

PRIMARY KEY eExpression2 TAG TagName2


Specifies a primary index to create. eExpression2 specifies any field or combination of fields in the table. TAG
TagName2 specifies the name for the primary index tag that is created. Index tag names can contain up to 10
characters.
Because a table can have only one primary index, you cannot include this clause if you have already created a
primary index for a field. Visual FoxPro generates an error if you include more than one PRIMARY KEY clause in
CREATE TABLE.
UNIQUE eExpression3TAG TagName3
Creates a candidate index. eExpression3 specifies any field or combination of fields in the table. However, if you
have created a primary index with one of the PRIMARY KEY options, you cannot include the field that was
specified for the primary index. TAG TagName3 specifies a tag name for the candidate index tag that is created.
Index tag names can contain up to 10 characters.
A table can have multiple candidate indexes.
FOREIGN KEY eExpression4TAG TagName4[NODUP ]
Creates a foreign (nonprimary) index and establishes a relationship to a parent table. eExpression4 specifies the
foreign index key expression, and TagName4 specifies the name of the foreign index key tag that is created. Index
tag names can contain up to 10 characters. Include NODUP to create a candidate foreign index.
You can create multiple foreign indexes for the table, but the foreign index expressions must specify different
fields in the table.
REFERENCES TableName3[TAG TagName5]
Specifies the parent table to which a persistent relationship is established. Include TAG TagName5 to establish a
relation based on an index tag for the parent table. Index tag names can contain up to 10 characters. By default, if
you omit TAG TagName5, the relationship is established using the parent table's primary index key.
CHECK eExpression2[ERROR cMessageText2]
Specifies the table validation rule. ERROR cMessageText2 specifies the error message Visual FoxPro displays
when the table validation rule is executed. The message is displayed only when data is changed within a Browse
window or Edit window.
FROM ARRAY ArrayName
Specifies the name of an existing array whose contents are the name, type, precision, and scale for each field in
the table. The contents of the array can be defined with the AFIELDS ( ) function.

Remarks
The new table is opened in the lowest available work area and can be accessed by its alias. The new table is
opened exclusively, regardless of the current setting of SET EXCLUSIVE.
If a database is open and you don't include the FREE clause, the new table is added to the database. You cannot
create a new table with the same name as a table in the database.
If a database is open, CREATE TABLE - SQL requires exclusive use of the database. To open a database for
exclusive use, include EXCLUSIVE in OPEN DATABASE.
If a database isn't open when you create the new table, including the NAME, CHECK, DEFAULT, FOREIGN KEY,
PRIMARY KEY, or REFERENCES clauses generates an error.

NOTE
CREATE TABLE syntax uses commas to separate certain CREATE TABLE options. Also, the NULL, NOT NULL, CHECK,
DEFAULT, PRIMARY KEY, and UNIQUE clause must be placed within the parentheses containing the column definitions.
Driver Remarks
When your application sends the ODBC SQL statement CREATE TABLE to the data source, the Visual FoxPro
ODBC Driver translates the command into the Visual FoxProCREATE TABLE command using the syntax shown
in the following table.

ODBC SYNTAX VISUAL FOXPRO SYNTAX

CREATE TABLE base-table-name CREATE TABLE TableName1 [NAME LongTableName]

(column-identifier data type (FieldName1 FieldType

[NOT NULL] [(nFieldWidth [, nPrecision])]

[,column-identifier data type [NOT NULL])

[NOT NULL] ...)

When you create a table using the driver, the driver closes the table immediately after creation to allow access to
the table by other users. This differs from Visual FoxPro, which leaves the table open exclusively upon creation.
However, if a stored procedure on your data source containing a CREATE TABLE statement executes, the table is
left open.
If the data source is a database (.dbc file), the Visual FoxPro ODBC Driver creates a table named LongTableName
with the same name as the base-table-name.
Using Data Definition Language (DDL )
You cannot include DDL in the following places:
In a batch SQL statement that requires a transaction
In manual-commit mode, after a statement that required a transaction, unless your application first calls
SQLTransact.
For example, if you want to create a temporary table, you should create the table before you begin the
statement requiring a transaction. If you include the CREATE TABLE statement in a batch SQL statement
that requires a transaction, the driver returns an error message.

See Also
ALTER TABLE - SQL Command
Supported Data Types (Visual FoxPro ODBC Driver)
INSERT - SQL Command
SELECT - SQL Command
DELETE - SQL Command
12/20/2017 • 1 min to read • Edit Online

Marks records for deletion.


The Visual FoxPro ODBC Driver supports the native Visual FoxPro language syntax for this command. For driver-
specific information, see the Remarks.

Syntax
DELETE FROM [DatabaseName!]TableName
[WHERE FilterCondition1 [AND | OR FilterCondition2 ...]]

Arguments
FROM [ DatabaseName!] TableName
Specifies the table in which records are marked for deletion.
DatabaseName! specifies the name of a database that contains the table if the containing database is not the
database specified with the data source. You must include the name of a database that contains the table if the
database is not the database specified with the data source. Include the exclamation point (!) delimiter after the
database name and before the table name.
WHERE FilterCondition1[AND | OR FilterCondition2...]
Specifies that Visual FoxPro mark only certain records for deletion.
FilterCondition specifies the criteria that records must meet to be marked for deletion. You can include as many
filter conditions as you want, connecting them with the AND or OR operator. You can also use the NOT operator
to reverse the value of a logical expression, or you can use EMPTY ( ) to check for an empty field.

Remarks
If SET DELETED is set to ON, records marked for deletion are ignored by all commands that include a scope.
DELETE - SQL uses record locking when marking multiple records for deletion in tables opened for shared access.
This reduces record contention in multiuser situations but can decrease performance. For maximum performance,
open the table for exclusive use.

Driver Remarks
When your application sends the ODBC SQL statement DELETE to the data source, the Visual FoxPro ODBC
Driver converts the command into the Visual FoxPro DELETE command without translation.

See Also
SET DELETED Command
DELETE TAG Command
12/20/2017 • 1 min to read • Edit Online

Removes a tag or tags from a compound index (.cdx) file.

Syntax
DELETE TAG TagName1 [OF CDXFileName1]
[, TagName2 [OF CDXFileName2]] ...
Or
DELETE TAG ALL [OF CDXFileName]

Arguments
TagName1OF CDXFileName1[, TagName2[OF CDXFileName2]] ...
Specifies a tag to remove from a compound index file. You can delete multiple tags with one DELETE TAG by
including a list of tag names separated by commas. If two or more tags with the same name exist in the open index
files, you can remove a tag from a specific index file by including OF CDXFileName.
ALL [OF CDXFileName]
Removes every tag from a compound index file. If the current table has a structural compound index file, all tags
are removed from the index file, the index file is deleted from the disk, and the flag in the table's header indicating
the presence of an associated structural compound index file is removed. Use ALL with OF CDXFileName to
remove all tags from an open compound index file other than the structural compound index file.

Remarks
Compound index files, created with INDEX, contain tags corresponding to index entries. DELETE TAG is used to
remove a tag or tags from open compound index files. You can delete only tags from compound index files open in
the current work area. If you remove all the tags from a compound index file, the file is deleted from the disk.
Visual FoxPro looks first for a tag in the structural compound index file (if one is open). If the tag isn't in the
structural compound index file, Visual FoxPro then looks for the tag in the other open compound index files.

See Also
INDEX Command
DROP TABLE Command
12/20/2017 • 1 min to read • Edit Online

Removes a table from the database specified with the data source and deletes it from disk.
The Visual FoxPro ODBC Driver supports the native Visual FoxPro language syntax for this command. For driver-
specific information, see the Remarks.

Syntax
DROP TABLE TableName | FileName | ?

Settings
TableName
Specifies the table to remove from the database specified with the data source and to delete from disk.
FileName
Specifies a free table to delete from disk.
?
Displays the Remove dialog from which you can choose a table to remove from the database specified with the
data source and to delete from disk.

Remarks
When DROP TABLE is issued, all primary indexes, default values, and validation rules associated with the table are
also removed. DROP TABLE also affects other tables in the database specified with the data source if those tables
have rules or relations associated with the table being removed. The rules and relations are no longer valid when
the table is removed from the database.

Driver Remarks
When your application sends the ODBC SQL statement DROP TABLE to the data source, the Visual FoxPro
ODBC Driver converts the command into the Visual FoxProDROP TABLE command using the syntax shown in
the following table.

ODBC SYNTAX DATA SOURCE VISUAL FOXPRO SYNTAX

DROP TABLE base-table-name Database (.dbc file) REMOVE TABLE TableName DELETE

Directory of free tables (.dbf files) ERASE dbfName

ERASE cdxName

ERASE fptName
INDEX Command
12/20/2017 • 5 min to read • Edit Online

Creates an index file to display and access table records in a logical order.

Syntax
INDEX ON eExpression TO IDXFileName | TAG TagName [OF CDXFileName]
[FOR lExpression]
[COMPACT]
[ASCENDING | DESCENDING]
[UNIQUE | CANDIDATE]
[ADDITIVE]

Arguments
eExpression
Specifies an index expression that can include the name of a field or fields from the current table. An index key
based on the index expression is created in the index file for each record in the table. Visual FoxPro uses these
keys to display and access records in the table.

NOTE
Although not recommended, eExpression can also be a memory variable, an array element, or a field or field expression
from a table in another work area. Memo fields cannot be used alone in index file expressions; they must be combined with
other character expressions. If you access an index that contains a variable or field that no longer exists or cannot be
located, Visual FoxPro generates an error message.

If you attempt to build an index with a key that varies in length, the key will be padded with spaces. Variable-
length index keys aren't supported in Visual FoxPro.
It is possible to create an index key with zero length. For example, a zero length index key is created when the
index expression is a substring of an empty memo field. A zero length index key generates an error message.
When Visual FoxPro creates an index, it evaluates fields in the first record in the table. If a field is empty, it might
be necessary to enter some temporary data in the field in the first record to prevent a 0-length index key.
TO IDXFileName
Creates an .idx index file. The index file is given the default extension .idx.
TAG TagName[OF CDXFileName]
Creates a compound index file. A compound index file is a single index file that consists of any number of
separate tags (index entries). Each tag is identified by its unique tag name. Tag names must begin with a letter or
an underscore and can consist of any combination of up to 10 letters, digits, or underscores. The number of tags
in a compound index file is limited only by available memory and disk space.
Multiple-entry compound index files are always compact. It isn't necessary to include COMPACT when creating a
compound index file. Names of compound index files are given a .cdx extension.
Two types of compound index files can be created: structural and nonstructural.
Structural Compound Index Files You can create a structural compound index file with TAG TagName by
excluding the optional OF CDXFileName clause. A structural compound index file always has the same base
name as the table and is automatically opened when the table is opened.
Nonstructural Compound Index Files You can create a nonstructural compound index file by including OF
CDXFileName after TAG TagName. Unlike a structural compound index file, a nonstructural compound index file
must be explicitly opened with the INDEX clause in USE.
If a compound index file has already been created and opened, issuing INDEX with TAG TagName adds a tag to
the compound index file.
FOR lExpression
Specifies a condition whereby only records that satisfy the filter expression lExpression are available for display
and access; index keys are created in the index file for just those records matching the filter expression.
Visual FoxPro Rushmore technology optimizes an INDEX ... FOR lExpression command if lExpression is an
optimizable expression. For best performance, use an optimizable expression in the FOR clause.
COMPACT
Creates a compact .idx file.
ASCENDING
Specifies an ascending order for the .cdx file. By default, .cdx tags are created in ascending order. (You can include
ASCENDING as a reminder of the index file's order.) A table can be indexed in reverse order by including
DESCENDING.
DESCENDING
Specifies a descending order for the .cdx file. You can't include DESCENDING when creating .idx index files.
UNIQUE
Specifies that only the first record encountered with a particular index key value is included in an .idx file or a .cdx
tag. UNIQUE can be used to prevent the display of or access to duplicate records. All records added with
duplicate index keys are excluded from the index file. Using the UNIQUE option of INDEX is identical to executing
SET UNIQUE ON before issuing INDEX or REINDEX.
When a UNIQUE index or index tag is active and a duplicate record is changed in a manner that changes its index
key, the index or index tag is updated. However, the next duplicate record with the original index key cannot be
accessed or displayed until you reindex the file using REINDEX.
CANDIDATE
Creates a candidate structural index tag. The CANDIDATE keyword can be included only when creating a
structural index tag; otherwise, Visual FoxPro generates an error message.
A candidate index tag prevents duplicate values in the field or combination of fields specified in the index
expression eExpression. The term candidate refers to the type of index; because candidate indexes prevent
duplicate values, they qualify as a "candidate" to be a primary index.
Visual FoxPro generates an error if you create a candidate index tag for a field or combination of fields that
already contains duplicate values.
ADDITIVE
Keeps open any previously opened index files. If you omit the ADDITIVE clause when you create an index file or
files for a table with INDEX, any previously opened index files (except the structural compound index) are closed.

Remarks
Records in a table that has an index file are displayed and accessed in the order specified by the index expression.
The physical order of the records in the table isn't changed by an index file.
Index Types
Visual FoxPro lets you create two types of index files:
Compound .cdx index files containing multiple index entries called tags
.idx index files containing one index entry
You can also create a structural compound index file, which is automatically opened with the table.

NOTE
Because structural compound index files are automatically opened when the table is opened, they are the preferred index
type.

Include COMPACT to create compact .idx index files. Compound index files are always compact.

Index Order and Updating


Only one index file (the master index file) or tag (the master tag) controls the order in which the table is displayed
or accessed. Certain commands (SEEK, for example) use the master index file or tag to search for records.
However, all open .idx and .cdx index files are updated as changes are made to the table.

User-Defined Functions
Although an index expression can contain a user-defined function, you should not use user-defined functions in
an index expression. User-defined functions in an index expression increase the time it takes to create or update
the index. Also, index updates might not occur when a user-defined function is used for an index expression.
If you use a user-defined function in an index expression, Visual FoxPro must be able to locate the user-defined
function. When Visual FoxPro creates an index, the index expression is saved in the index file but only a reference
to the user-defined function is included in the index expression.

See Also
ALTER TABLE - SQL Command
DELETE TAG Command
SET COLL ATE Command
SET UNIQUE Command
INSERT - SQL Command
12/20/2017 • 1 min to read • Edit Online

Appends a record to the end of a table that contains the specified field values.
The Visual FoxPro ODBC Driver supports the native Visual FoxPro language syntax for this command. For
driver-specific information, see the Remarks.

Syntax
INSERT INTO dbf_name [(fname1 [, fname2, ...])]
VALUES (eExpression1 [, eExpression2, ...])

Arguments
INSERT INTO dbf_name
Specifies the name of the table to which the new record is appended. dbf_name can include a path and can be a
name expression.
If the table you specify isn't open, it is opened exclusively in a new work area and the new record is appended to
the table. The new work area isn't selected; the current work area remains selected.
If the table you specify is open, INSERT appends the new record to the table. If the table is open in a work area
other than the current work area, it isn't selected after the record is appended; the current work area remains
selected.
[( fname1[, fname2[, ...]])]
Specifies in the new record the names of the fields into which the values are inserted.
VALUES ( eExpression1[, eExpression2[, ...]])
Specifies the field values inserted into the new record. If you omit the field names, you must specify the field
values in the order defined by the table structure.

Remarks
The new record contains the data listed in the VALUES clause.

Driver Remarks
When your application sends the ODBC SQL statement INSERT to the data source, the Visual FoxPro ODBC
Driver converts the command into the Visual FoxProINSERT command without translation.

See Also
CREATE TABLE - SQL Command
SELECT - SQL Command
SELECT - SQL Command
12/20/2017 • 11 min to read • Edit Online

Retrieves data from one or more tables.


The Visual FoxPro ODBC Driver supports the native Visual FoxPro language syntax for this command. For driver-
specific information, see Driver Remarks.

Syntax
SELECT [ALL | DISTINCT]
[Alias.] Select_Item [AS Column_Name]
[, [Alias.] Select_Item [AS Column_Name] ...]
FROM [DatabaseName!]Table [Local_Alias]
[, [DatabaseName!]Table [Local_Alias] ...]
[WHERE JoinCondition [AND JoinCondition
…]
[AND | OR FilterCondition [AND | OR FilterCondition ...]]]
[GROUP BY GroupColumn [, GroupColumn ...]]
[HAVING FilterCondition]
[UNION [ALL] SELECTCommand]
[ORDER BY Order_Item [ASC | DESC] [, Order_Item [ASC | DESC] ...]]

Arguments
NOTE
A subquery, referred to in the following arguments, is a SELECT within a SELECT and must be enclosed in parentheses. You
can have up to two subqueries at the same level (not nested) in the WHERE clause. (See that section of the arguments.)
Subqueries can contain multiple join conditions.

[ALL | DISTINCT] [Alias.] Select_Item [AS Column_Name] [, [Alias.] Select_Item [AS Column_Name] ...]
The SELECT clause specifies the fields, constants, and expressions that are displayed in the query results.
By default, ALL displays all the rows in the query results.
DISTINCT excludes duplicates of any rows from the query results.

NOTE
You can use DISTINCT only once per SELECT clause.

Alias. qualifies matching item names. Each item you specify with Select_Item generates one column of the query
results. If two or more items have the same name, include the table alias and a period before the item name to
prevent columns from being duplicated.
Select_Item specifies an item to be included in the query results. An item can be one of the following:
The name of a field from a table in the FROM clause.
A constant specifying that the same constant value is to appear in every row of the query results.
An expression that can be the name of a user-defined function.
User-Defined Functions with SELECT
Although using user-defined functions in the SELECT clause has obvious benefits, you should also consider
the following restrictions:
The speed of operations performed with SELECT might be limited by the speed at which such user-defined
functions are executed. High-volume manipulations involving user-defined functions might be better
accomplished by using API and user-defined functions written in C or assembly language.
The only reliable way to pass values to user-defined functions invoked from SELECT is by the argument list
passed to the function when it is invoked.
Even if you experiment and discover a supposedly forbidden manipulation that works correctly in a certain
version of FoxPro, there is no guarantee it will continue to work in later versions.
Apart from these restrictions, user-defined functions are acceptable in the SELECT clause. However,
remember that using SELECT might slow performance.
The following field functions are available for use with a select item that is a field or an expression involving
a field:
AVG (Select_Item)—Averages a column of numeric data.
COUNT(Select_Item)—Counts the number of select items in a column. COUNT(*) counts the number of
rows in the query output.
MIN (Select_Item)—Determines the smallest value of Select_Item in a column.
MAX(Select_Item)—Determines the largest value of Select_Item in a column.
SUM (Select_Item)—Totals a column of numeric data.
You cannot nest field functions.
AS Column_Name
Specifies the heading for a column in the query output. This is useful when Select_Item is an expression or
contains a field function and you want to give the column a meaningful name. Column_Name can be an
expression but cannot contain characters (for example, spaces) that are not permitted in table field names.
FROM [DatabaseName!]Table [Local_Alias] [, [DatabaseName!]Table [Local_Alias] ...]
Lists the tables that contain the data that the query retrieves. If no table is open, Visual FoxPro displays the
Open dialog box so that you can specify the file location. After it has been opened, the table remains open
after the query is complete.
DatabaseName! specifies the name of a database other than the one specified with the data source. You
must include the name of the database that contains the table if the database is not specified with the data
source. Include the exclamation point (!) delimiter after the database name and before the table name.
Local_Alias specifies a temporary name for the table named in Table. If you specify a local alias, you must
use the local alias instead of the table name throughout the SELECT statement. The local alias does not
affect the Visual FoxPro environment.
WHERE JoinCondition [AND JoinCondition ...] [AND | OR FilterCondition [AND | OR FilterCondition ...]]
Tells Visual FoxPro to include only certain records in the query results. WHERE is required to retrieve data
from multiple tables.
JoinCondition specifies fields that link the tables in the FROM clause. If you include more than one table in
a query, you should specify a join condition for every table after the first.
IMPORTANT
Consider the following information when you create join conditions:

If you include two tables in a query and do not specify a join condition, every record in the first table is
joined to every record in the second table as long as the filter conditions are met. Such a query can
produce lengthy results.
Use caution when joining tables with empty fields because Visual FoxPro matches empty fields. For
example, if you join on CUSTOMER.ZIP and INVOICE.ZIP and if CUSTOMER contains 100 empty zip
codes and INVOICE contains 400 empty zip codes, the query output contains 40,000 extra records
resulting from the empty fields. Use the EMPTY ( ) function to eliminate empty records from the query
output.
You must use the AND operator to connect multiple join conditions. Each join condition has the following
form:
FieldName1 Comparison FieldName2
FieldName1 is the name of a field from one table, FieldName2 is the name of a field from another table,
and Comparison is one of the operators described in the following table.

OPERATOR COMPARISON

= Equal

== Exactly equal

LIKE SQL LIKE

<>, !=, # Not equal

> More than

>= More than or equal to

< Less than

<= Less than or equal to

When you use the = operator with strings, it acts differently, depending on the setting of SET ANSI. When SET
ANSI is set to OFF, Visual FoxPro treats string comparisons in a manner familiar to Xbase users. When SET ANSI
is set to ON, Visual FoxPro follows ANSI standards for string comparisons. See SET ANSI and SET EXACT for
more information about how Visual FoxPro performs string comparisons.
FilterCondition specifies the criteria that records must meet to be included in the query results. You can include as
many filter conditions in a query as you want, connecting them with the AND or OR operator. You can also use
the NOT operator to reverse the value of a logical expression, or you can use EMPTY ( ) to check for an empty
field. FilterCondition can take any of the forms in the following examples:
Example 1 FieldName1 Comparison FieldName2
customer.cust_id = orders.cust_id

Example 2 FieldName Comparison Expression


payments.amount >= 1000

Example 3 FieldName Comparison ALL (Subquery)


company < ALL ;

(SELECT company FROM customer WHERE country = "USA")

When the filter condition includes ALL, the field must meet the comparison condition for all values generated by
the subquery before its record is included in the query results.
Example 4 FieldName Comparison ANY | SOME (Subquery)
company < ANY ;

(SELECT company FROM customer WHERE country = "USA")

When the filter condition includes ANY or SOME, the field must meet the comparison condition for at least one of
the values generated by the subquery.
The following example checks to see whether the values in the field are within a specified range of values:
Example 5 FieldName [NOT] BETWEEN Start_Range AND End_Range
customer.postalcode BETWEEN 90000 AND 99999

The following example checks to see whether at least one row meets the criteria in the subquery. When the filter
condition includes EXISTS, the filter condition evaluates to True (.T.) unless the subquery evaluates to the empty
set.
Example 6 [NOT] EXISTS (Subquery)
EXISTS ;

(SELECT * FROM orders WHERE customer.postalcode =

orders.postalcode)

Example 7 FieldName [NOT] IN Value_Set


customer.postalcode NOT IN ("98052","98072","98034")

When the filter condition includes IN, the field must contain one of the values before its record is included in the
query results.
Example 8 FieldName [NOT] IN (Subquery)
customer.cust_id IN ;

(SELECT orders.cust_id FROM orders WHERE orders.city="Seattle")

Here the field must contain one of the values returned by the subquery before its record is included in the query
results.
Example 9 FieldName [NOT] LIKE cExpression
customer.country NOT LIKE "USA"

This filter condition searches for each field that matches cExpression. You can use the percent sign (%) and
underscore ( _ ) wildcard characters as part of cExpression. The underscore represents a single unknown character
in the string.
GROUP BY GroupColumn [, GroupColumn ...]
Groups rows in the query based on values in one or more columns. GroupColumn can be one of the following:
The name of a regular table field.
A field that includes an SQL field function.
A numeric expression that indicates the location of the column in the result table. (The leftmost column
number is 1.)
HAVING FilterCondition
Specifies a filter condition that groups must meet to be included in the query results. HAVING should be
used with GROUP BY and can include as many filter conditions as you want, connected by the AND or OR
operator. You can also use NOT to reverse the value of a logical expression.
FilterCondition cannot contain a subquery.
A HAVING clause without a GROUP BY clause behaves like a WHERE clause. You can use local aliases and
field functions in the HAVING clause. Use a WHERE clause for faster performance if your HAVING clause
contains no field functions.
[UNION [ALL ] SELECTCommand]
Combines the final results of one SELECT with the final results of another SELECT. By default, UNION
checks the combined results and eliminates duplicate rows. Use parentheses to combine multiple UNION
clauses.
ALL prevents UNION from eliminating duplicate rows from the combined results.
UNION clauses follow these rules:
You cannot use UNION to combine subqueries.
Both SELECT commands must have the same number of columns in their query output.
Each column in the query results of one SELECT must have the same data type and width as the
corresponding column in the other SELECT.
Only the final SELECT can have an ORDER BY clause, which must refer to output columns by number. If an
ORDER BY clause is included, it affects the complete result.
You can also use the UNION clause to simulate an outer join.
When you join two tables in a query, only records with matching values in the joining fields are included in
the output. If a record in the parent table does not have a corresponding record in the child table, the
record in the parent table is not included in the output. An outer join lets you include all the records in the
parent table in the output, together with the matching records in the child table. To create an outer join in
Visual FoxPro, you must use a nested SELECT command, as in the following example:

SELECT customer.company, orders.order_id, orders.emp_id ;


FROM customer, orders ;
WHERE customer.cust_id = orders.cust_id ;
UNION ;
SELECT customer.company, 0, 0 ;
FROM customer ;
WHERE customer.cust_id NOT IN ;
(SELECT orders.cust_id FROM orders)

NOTE
Make sure that you include the space that immediately precedes each semicolon. Otherwise, you will receive an error.
The section of the command before the UNION clause selects records from both tables that have matching
values. The customer companies that do not have associated invoices are not included. The section of the
command after the UNION clause selects records in the customer table that do not have matching records in the
orders table.
Regarding the second section of the command, note the following:
The SELECT statement within the parentheses is processed first. This statement creates a selection of all
customer numbers in the orders table.
The WHERE clause finds all customer numbers in the customer table that are not in the orders table.
Because the first section of the command provided all companies that had a customer number in the
orders table, all companies in the customer table are now included in the query results.
Because the structures of tables included in a UNION must be identical, there are two placeholders in the
second SELECT statement to represent orders.order_id and orders.emp_id from the first SELECT
statement.

NOTE
The placeholders must be the same type as the fields that they represent. If the field is a date type, the placeholder
should be { / / }. If the field is a character field, the placeholder should be the empty string ("").

ORDER BY Order_Item [ASC | DESC ] [, Order_Item [ASC | DESC ] ...]


Sorts the query results based on the data in one or more columns. Each Order_Item must correspond to a
column in the query results and can be one of the following:
A field in a FROM table that is also a select item in the main SELECT clause (not in a subquery).
A numeric expression that indicates the location of the column in the result table. (The leftmost column is
number 1.)
ASC specifies an ascending order for query results, according to the order item or items, and is the default
for ORDER BY.
DESC specifies a descending order for query results.
Query results appear unordered if you do not specify an order with ORDER BY.

Remarks
SELECT is an SQL command that is built into Visual FoxPro like any other Visual FoxPro command. When you
use SELECT to pose a query, Visual FoxPro interprets the query and retrieves the specified data from the tables.
You can create a SELECT query from within either the Command Prompt window or a Visual FoxPro program (as
with any other Visual FoxPro command).

NOTE
SELECT does not respect the current filter condition specified with SET FILTER.

Driver Remarks
When your application sends the ODBC SQL statement SELECT to the data source, the Visual FoxPro ODBC
Driver converts the command into the Visual FoxPro SELECT command without translation unless the command
contains an ODBC escape sequence. Items enclosed in an ODBC escape sequence are converted to Visual FoxPro
syntax. For more information about using ODBC escape sequences, see Time and Date Functions and in the
Microsoft ODBC Programmer's Reference, see Escape Sequences in ODBC.

See Also
CREATE TABLE - SQL
INSERT - SQL
SET ANSI
SET EXACT
SET ANSI Command
12/20/2017 • 1 min to read • Edit Online

Determines how comparisons between strings of different lengths are made with the = operator in Visual FoxPro
SQL commands.

Syntax
SET ANSI ON | OFF

Arguments
ON
(Default for the driver; the default for Visual FoxPro is OFF.) Pads the shorter string with the blanks needed to
make it equal to the longer string's length. The two strings are then compared character for character for their
entire lengths. Consider this comparison:

'Tommy' = 'Tom'

The result is False (.F.) if SET ANSI is on, because when padded, 'Tom' becomes 'Tom ' and the strings 'Tom ' and
'Tommy' don't match character for character.
The == operator uses this method for comparisons in Visual FoxPro SQL commands.
OFF
Specifies that the shorter string not be padded with blanks. The two strings are compared character for character
until the end of the shorter string is reached. Consider this comparison:

'Tommy' = 'Tom'

The result is True (.T.) when SET ANSI is off, because the comparison stops after 'Tom'.

Remarks
SET ANSI determines whether the shorter of two strings is padded with blanks when an SQL string comparison
is made. SET ANSI has no effect on the == operator; when you use the == operator, the shorter string is always
padded with blanks for the comparison.

String Order
In SQL commands, the left-to-right order of the two strings in a comparison is irrelevantswitching a string from
one side of the = or == operator to the other doesn't affect the result of the comparison.

See Also
SELECT - SQL Command
SET EXACT Command
SET BLOCKSIZE Command
12/20/2017 • 1 min to read • Edit Online

Specifies how disk space is allocated for the storage of memo fields.

Syntax
SET BLOCKSIZE TO nBytes

Arguments
nBytes
Specifies the block size in which disk space for memo fields is allocated. If nBytes is 0, disk space is allocated in
single bytes (blocks of 1 byte). If nBytes is an integer between 1 and 32, disk space is allocated in blocks of nBytes
bytes multiplied by 512. If nBytes is greater than 32, disk space is allocated in blocks of nBytes bytes. If you specify
a block size value greater than 32, you can save substantial disk space.

Remarks
The default value for SET BLOCKSIZE is 64. To reset the block size to a different value after the file has been
created, set it to a new value and then use COPY to create a new table. The new table has the specified block size.
SET COLLATE Command
12/20/2017 • 1 min to read • Edit Online

Specifies a collation sequence for character fields in subsequent indexing and sorting operations.

Syntax
SET COLLATE TO cSequenceName

Arguments
cSequenceName
Specifies a collation sequence. The available collation sequence options are described in the following table.

OPTIONS LANGUAGE

DUTCH Dutch

GENERAL English, French, German, Modern Spanish, Portuguese, and


other Western European languages

GERMAN German phone book order (DIN)

ICELAND Icelandic

MACHINE Machine (the default collation sequence for earlier FoxPro


versions)

NORDAN Norwegian, Danish

SPANISH Traditional Spanish

SWEFIN Swedish, Finnish

UNIQWT Unique Weight

NOTE
When you specify the SPANISH option, ch is a single letter that sorts between c and d, and ll sorts between l and m.

If you specify a collation sequence option as a literal character string, be sure to enclose the option in quotation
marks:

SET COLLATE TO "SWEFIN"

MACHINE is the default collation sequence option and is the sequence Xbase users are familiar with. Characters
are ordered as they appear in the current code page.
GENERAL may be preferable for U.S. and Western European users. Characters are ordered as they appear in the
current code page. In FoxPro versions earlier than 2.5, indexes might have been created using the UPPER( ) or
LOWER( ) functions to convert character fields to a consistent case. In FoxPro versions later than 2.5, you can
instead specify the GENERAL collation sequence option and omit the UPPER( ) conversion.
If you specify a collation sequence option other than MACHINE and if you create an .idx file, a compact .idx is
always created.
Use SET("COLL ATE") to return the current collation sequence.
You can specify a collating sequence for a data source by using the ODBC Visual FoxPro Setup Dialog Box or by
using the Collate keyword in your connection string with SQLDriverConnect. This is identical to issuing the
following command:

SET COLLATE TO cSequenceName

Remarks
SET COLL ATE enables you to order tables containing accented characters for any of the supported languages.
Changing the setting of SET COLL ATE doesn't affect the collating sequence of previously opened indexes. Visual
FoxPro automatically maintains existing indexes, providing the flexibility to create many different types of indexes,
even for the same field.
For example, if an index is created with SET COLL ATE set to GENERAL and the SET COLL ATE setting is later
changed to SPANISH, the index retains the GENERAL collation sequence.

See Also
ODBC Visual FoxPro Setup Dialog Box
SET DELETED Command
12/20/2017 • 1 min to read • Edit Online

Specifies whether records marked for deletion are processed and whether they are available for use in other
commands.

Syntax
SET DELETED ON | OFF

Arguments
ON
(Default for the driver; the default for Visual FoxPro is OFF.) Specifies that commands that operate on records
(including records in related tables) using a scope ignore records marked for deletion.
OFF
Specifies that records marked for deletion can be accessed by commands that operate on records (including
records in related tables) using a scope.

Remarks
Queries that use DELETED ( ) to test the status of records can be optimized using Visual FoxPro Rushmore
technology if the table is indexed on DELETED ( ).

IMPORTANT
SET DELETED is ignored if the default scope for the command is the current record or if you include a scope of a single
record. INDEX always ignores SET DELETED and indexes all records in the table.

See Also
DELETE - SQL Command
SET EXACT Command
12/20/2017 • 2 min to read • Edit Online

Specifies the rules for comparing two strings of different lengths.

Syntax
SET EXACT ON | OFF

Arguments
ON
Specifies that expressions must match character for character to be equivalent. Any trailing blanks in the
expressions are ignored for the comparison. For the comparison, the shorter of the two expressions is padded on
the right with blanks to match the length of the longer expression.
OFF
(Default.) Specifies that, to be equivalent, expressions must match character for character until the end of the
expression on the right side is reached.

Remarks
The SET EXACT setting has no effect if both strings are the same length.

String Comparisons
Visual FoxPro has two relational operators that test for equality.
The = operator performs a comparison between two values of the same type. This operator is suited for
comparing character, numeric, date, and logical data.
However, when you compare character expressions with the = operator, the results might not be exactly what you
expect. Character expressions are compared character for character from left to right until one of the expressions
isn't equal to the other, until the end of the expression on the right side of the = operator is reached (SET EXACT
OFF ), or until the ends of both expressions are reached (SET EXACT ON ).
The == operator can be used when an exact comparison of character data is needed. If two character expressions
are compared with the == operator, the expressions on both sides of the == operator must contain exactly the
same characters, including blanks, to be considered equal. The SET EXACT setting is ignored when character
strings are compared using ==.
The following table shows how the choice of operator and the SET EXACT setting affect comparisons. (An
underscore represents a blank space.)

COMPARISON = EXACT OFF = EXACT ON == EXACT ON OR OFF

"abc" = "abc" Match Match Match

"ab" = "abc" No match No match No match


COMPARISON = EXACT OFF = EXACT ON == EXACT ON OR OFF

"abc" = "ab" Match No match No match

"abc" = "ab_" No match No match No match

"ab" = "ab_" No match Match No match

"ab_" = "ab" Match Match No match

"" = "ab" No match No match No match

"ab" = "" Match No match No match

"__" = "" Match Match No match

"" = "_" No match Match No match

TRIM("_") = "" Match Match Match

"" = TRIM("_") Match Match Match

See Also
SET ANSI Command
SET EXCLUSIVE Command
12/20/2017 • 1 min to read • Edit Online

Specifies whether table files are opened for exclusive or shared use on a network.

Syntax
SET EXCLUSIVE ON | OFF

Arguments
ON
Limits accessibility of a table opened on a network to the user who opened it. The table isn't accessible to other
users on the network. SET EXCLUSIVE ON also prevents all other users from having read-only access.
OFF
(Default for the driver; the defaults for Visual FoxPro are ON for the global data session and OFF for a private
data session.) Allows a table opened on a network to be shared and modified by any user on the network.

Remarks
Changing the setting of SET EXCLUSIVE doesn't change the status of previously opened tables. For example, if a
table is opened with SET EXCLUSIVE set to ON and SET EXCLUSIVE is later changed to OFF, the table retains its
exclusive-use status.

See Also
ODBC Visual FoxPro Setup Dialog Box
SET NULL Command
12/20/2017 • 1 min to read • Edit Online

Determines how null values are supported by the ALTER TABLE - SQL, CREATE TABLE - SQL, and INSERT - SQL
commands.

Syntax
SET NULL ON | OFF

Arguments
ON
(Default for the driver; the default for Visual FoxPro is OFF.) Specifies that all columns in a table created with
ALTER TABLE and CREATE TABLE will allow null values. You can override null value support for columns in the
table by including the NOT NULL clause in the columns' definitions.
Also specifies that INSERT - SQL will insert null values into any columns not included in the INSERT - SQL
VALUE clause. INSERT - SQL will insert null values only into columns that allow null values.
OFF
Specifies that all columns in a table created with ALTER TABLE and CREATE TABLE will not allow null values. You
can designate null value support for columns in ALTER TABLE and CREATE TABLE by including the NULL clause
in the columns' definitions.
Also specifies that INSERT - SQL will insert blank values into any columns not included in the INSERT - SQL
VALUE clause.

Remarks
SET NULL affects only how null values are supported by ALTER TABLE, CREATE TABLE, and INSERT - SQL.
Other commands are unaffected by SET NULL.

See Also
ALTER TABLE - SQL Command
CREATE TABLE - SQL Command
INSERT - SQL Command
SET PATH Command
12/20/2017 • 1 min to read • Edit Online

Specifies a path for file searches. For driver-specific information, see the Remarks.

Syntax
SET PATH TO [Path]

Arguments
TO [ Path]
Specifies the directories you want Visual FoxPro to search. Use commas or semicolons to separate the directories.

Remarks
SET PATH allows you to specify search paths for other Visual FoxPro programs that can be called within stored
procedures. SET PATH will not change the path of the data source that you've specified for the connection.
Issue SET PATH TO without Path to restore the path to the default directory or folder.

Driver Remarks
If you issue SET PATH in a stored procedure, it will be ignored by the following functions and commands:
Catalog functions such as SQLTables and SQLColumns will ignore the new path and continue to reference
the path specified by the data source in SQLPrepare or SQLExecDirect.
Commands such as SELECT, INSERT, UPDATE, DELETE, and CREATE TABLE will ignore the new path and
continue to reference the path specified by the data source in SQLPrepare or SQLExecDirect.
If you issue SET PATH in a stored procedure and don't subsequently set the path back to its original state,
other connections to the database will use the new path (because SET PATH is not scoped to data sessions).
If you want to create, select, or update tables in a directory other than that specified by the data source,
specify the full path of the file with your command.

See Also
ODBC Visual FoxPro Setup Dialog Box
SQLColumns (Visual FoxPro ODBC Driver)
SQLDriverConnect (Visual FoxPro ODBC Driver)
SQLTables (Visual FoxPro ODBC Driver)
SET REPROCESS Command
12/20/2017 • 2 min to read • Edit Online

Specifies how many times or for how long to lock a file or record after an unsuccessful locking attempt.

Syntax
SET REPROCESS TO nAttempts [SECONDS] | TO AUTOMATIC

Arguments
TO nAttempts[SECONDS ]
Specifies the number of times or number of seconds to try to lock a record or file after an initial unsuccessful
attempt. The default value is 0; the maximum value is 32,000.
SECONDS specifies that Visual FoxPro attempts to lock a file or record for nAttempts seconds. It's available only
when nAttempts is greater than zero.
For example, if nAttempts is 30, Visual FoxPro attempts to lock a record or file up to 30 times. If you also include
SECONDS (SET REPROCESS TO 30 SECONDS ), Visual FoxPro continuously attempts to lock a record or file for
up to 30 seconds.
If an ON ERROR routine is in effect and if attempts by a command to lock the record or file are unsuccessful, the
ON ERROR routine is executed. However, if a function attempts the lock, an ON ERROR routine isn't executed
and the function returns False (.F.).
If an ON ERROR routine isn't in effect, a command attempts to lock the record or file, and the lock can't be placed,
an error is generated. If a function attempts to place the lock, the alert isn't displayed and the function returns
False (.F.).
If nAttempts is 0 (the default value) and you issue a command or function that attempts to lock a record or file,
Visual FoxPro tries to lock the record or file indefinitely. If the record or file becomes available for locking while
you wait, the lock is placed and the system message is cleared. If a function attempted to place the lock, the
function returns True (.T.).
If an ON ERROR routine is in effect and a command is attempting to lock the record or file, the ON ERROR
routine takes precedence over additional attempts to lock the record or file. The ON ERROR routine is
immediately executed. Visual FoxPro does not attempt additional record or file locks and does not display the
system message.
If nAttempts is 1, Visual FoxPro attempts to lock the record or file indefinitely and an ON ERROR routine isn't
executed.
If a lock has been placed by another user on the record or file you are attempting to lock, you must wait until the
user releases the lock.
TO AUTOMATIC
Specifies that Visual FoxPro attempts to lock the record or file indefinitely. (SET REPROCESS TO -2 is an
equivalent command.)
Remarks
The first attempt to lock a record or file isn't always successful. Frequently, a record or file is locked by another user
on the network. SET REPROCESS determines whether Visual FoxPro makes additional attempts to lock the
record or file when the initial attempt is unsuccessful. You can specify either how many times additional attempts
are made or for how long the attempts are made. An ON ERROR routine affects how unsuccessful lock attempts
are handled.
SET UNIQUE Command
12/20/2017 • 1 min to read • Edit Online

Specifies whether records with duplicate index key values are maintained in an index file.

Syntax
SET UNIQUE ON | OFF

Arguments
ON
Specifies that any record with a duplicate index key value not be included in the index file. Only the first record
with the original index key value is included in the index file.
OFF
(Default.) Specifies that records with duplicate index key values be included in the index file.

Remarks
An index file retains its SET UNIQUE setting when you issue REINDEX. For more information, see INDEX.
UPDATE - SQL Command
12/20/2017 • 1 min to read • Edit Online

Updates records in a table with new values.


The Visual FoxPro ODBC Driver supports the native Visual FoxPro language syntax for this command. For driver-
specific information, see Driver Remarks.

Syntax
UPDATE [DatabaseName1!]TableName1
SET Column_Name1 = eExpression1
[, Column_Name2 = eExpression2 ...]
WHERE FilterCondition1 [AND | OR FilterCondition2 ...]

Arguments
UPDATE [ DatabaseName1!] TableName1
Specifies the table in which records are updated with new values.
DatabaseName1! specifies the name of a database other than the database specified with the data source
containing the table. You must include the name of the database containing the table if the database is not the
current one. Include the exclamation point (!) delimiter after the database name and before the table name.
SET Column_Name1= eExpression1[, Column_Name2= eExpression2
Specifies the columns that are updated and their new values. If you omit the WHERE clause, every row in the
column is updated with the same value.
WHERE FilterCondition1[AND | OR FilterCondition2...]
Specifies the records that are updated with new values.
FilterCondition specifies the criteria that records must meet to be updated with new values. You can include as
many filter conditions as you like, connecting them with the AND or OR operator. You can also use the NOT
operator to reverse the value of a logical expression, or you can use EMPTY ( ) to check for an empty field.

Remarks
UPDATE - SQL can update only records in a single table.
Unlike REPL ACE, UPDATE - SQL uses record locking when updating multiple records in tables opened for shared
access. This reduces record contention in multiuser situations but can reduce performance. For maximum
performance, open the table for exclusive use or use FLOCK( ) to lock the table.

Driver Remarks
When your application sends the ODBC SQL statement UPDATE to the data source, the Visual FoxPro ODBC
Driver converts the command into the Visual FoxProUPDATE command without translation.

See Also
DELETE - SQL Command
INSERT - SQL Command
Visual FoxPro Field Data Types
12/20/2017 • 1 min to read • Edit Online

The following table lists the values for the FieldType argument in ALTER TABLE and CREATE TABLE and indicates
whether nFieldWidth and nPrecision arguments are required.

FIELDTYPE NFIELDWIDTH NPRECISION DESCRIPTION

B - d Double

C N - Character field of width n

D - - Date

F N d Floating numeric field of


width n with d decimal
places

G - - General

I - - Integer

L - - Logical

M - - Memo

N N d Numeric field of width n with


d decimal places

T - - DateTime

Y - - Currency

You might also like