Visual FoxPro ODBC Driver
Visual FoxPro ODBC Driver
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.
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.
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.
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.
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 following table shows the Desktop Database Drivers version history.
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.
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.
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.
SQL_DESC_ALLOC_TYPE Supported
SQL_DESC_ARRAY_STATUS_PTR Supported
SQL_DESC_BIND_OFFSET_PTR Supported
SQL_DESC_BIND_TYPE Supported
SQL_DESC_COUNT Supported
SQL_DESC_AUTO_UNIQUE_VALUE Supported
SQL_DESC_CONCISE_TYPE Supported
SQL_DESC_DATA_PTR Supported
SQL_DESC_DATETIME_INTERVAL_CODE Supported
SQL_DESC_DISPLAY_SIZE Supported
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_NAME Supported
SQL_DESC_NULLABLE Supported
SQL_DESC_NUM_PREC_RADIX Supported
SQL_DESC_OCTET_LENGTH Supported
SQL_DESC_OCTET_LENGTH_PTR Supported
SQL_DESC_PRECISION Supported
SQL_DESC_SCALE Supported
SQL_DESC_SEARCHABLE 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.
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_MESSAGE_TEXT Supported
SQL_DIAG_NATIVE Supported
SQL_DIAG_NUMBER Supported
SQL_DIAG_ROW_COUNT Supported
SQL_DIAG_ROW_NUMBER 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
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.
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.
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.
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.
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
[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.
BINARY, VARBINARY, and VARCHAR Creating a BINARY, VARBINARY, or VARCHAR column of zero
or unspecified length actually returns a 510-byte column.
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 (').
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.
SQL_ACCESSIBLE_PROCEDURES "Y"
SQL_ACCESSIBLE_TABLES "Y"
SQL_ACTIVE_ENVIRONMENTS 0
SQL_ALTER_DOMAIN 0
SQL_ALTER_TABLE 0
SQL_ASYNC_MODE 0
SQL_BATCH_ROW_COUNT 0
SQL_BATCH_SUPPORT 0
SQL_CATALOG_LOCATION SQL_QL_START
SQL_CATALOG_NAME "Y"
SQL_CATALOG_NAME_SEPARATOR "."
SQL_CATALOG_TERM "Database"
SQL_COLLATION_SEQ ""
SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE
SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL
SQL_CONVERT_BIGINT 0
SQL_CONVERT_BIT 0
SQL_CONVERT_DECIMAL 0
SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT
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_READ_ONLY "N"
SQL_DATETIME_LITERALS 0
SQL_DBMS_NAME "ACCESS"
SQL_DEFAULT_TXN_ISOLATION SQL_TXN_READ_COMMITTED
SQL_DESCRIBE_PARAMETER 0
SQL_DRIVER_NAME "OdbcJt32.dll"
SQL_DRIVER_ODBC_VER "3.51.0000"
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_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT
SQL_IDENTIFIER_CASE SQL_IC_MIXED
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_ODBC_SQL_INTEGRITY "N"
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_SEARCH_PATTERN_ESCAPE "\"
SQL_SERVER_NAME "ACCESS"
SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"
SQL_SYSTEM_FUNCTIONS 0
SQL_TABLE_TERM "TABLE"
SQL_TIMEDATE_ADD_INTERVALS 0
SQL_TIMEDATE_DIFF_INTERVALS 0
SQL_TXN_CAPABLE SQL_TC_ALL
SQL_TXN_ISOLATION_OPTION SQL_TXN_READ_COMMITTED
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.
NOTE
This topic provides Access Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
ATTRIBUTE COMMENTS
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
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
"C:\PROGRAM FILES\Access2.mdb"
"C:\PROGRAM FILES\Access2.mdb"
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.
SYSTEMDB For the Microsoft Access driver, the path specification to the
system database file.
UID For the Microsoft Access driver, the user ID name used for
login.
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.
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
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
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_CURRENT_QUALIFIER Supported.
SQL_OPT_TRACE Supported.
SQL_OPT_TRACEFILE Supported.
[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
INDEX_NAME Index-dependent.
SEQ_IN_INDEX Index-dependent.
COLUMN_NAME Index-dependent.
COLLATION Index-dependent.
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
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
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.
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
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.
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.
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.
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.
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.
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.
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.
SQL_ACCESSIBLE_PROCEDURES "N"
SQL_ACCESSIBLE_TABLES "Y"
SQL_ACTIVE_ENVIRONMENTS 0
SQL_ALTER_DOMAIN 0
SQL_ALTER_TABLE 0
SQL_ASYNC_MODE 0
SQL_BATCH_ROW_COUNT 0
SQL_BATCH_SUPPORT 0
SQL_CATALOG_LOCATION SQL_QL_START
SQL_CATALOG_NAME "Y"
SQL_COLLATION_SEQ ""
SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE
SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL
SQL_CONVERT_BIGINT 0
SQL_CONVERT_BIT 0
SQL_CONVERT_DECIMAL 0
SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT
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_READ_ONLY "Y"
SQL_DATETIME_LITERALS 0
SQL_DBMS_NAME "EXCEL"
SQL_DDL_INDEX 0
SQL_DEFAULT_TXN_ISOLATION 0
SQL_DESCRIBE_PARAMETER 0
SQL_DRIVER_NAME "OdbcJt32.dll"
SQL_DRIVER_ODBC_VER "3.51.0000"
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_FORWARD_ONLY_CURSOR_ATTRIBUTES1 SQL_CA1_NEXT
SQL_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT
SQL_IDENTIFIER_CASE SQL_IC_MIXED
SQL_LIKE_ESCAPE_CLAUSE "N"
SQL_MAX_BINARY_LITERAL_LEN 255
SQL_MAX_CATALOG_NAME_LEN 66
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
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_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_ODBC_SQL_INTEGRITY "N"
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_SEARCH_PATTERN_ESCAPE "\"
SQL_SERVER_NAME "EXCEL"
SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"
SQL_SYSTEM_FUNCTIONS 0
SQL_TABLE_TERM "TABLE"
SQL_TIMEDATE_ADD_INTERVALS 0
SQL_TIMEDATE_DIFF_INTERVALS 0
SQL_TXN_CAPABLE SQL_TC_NONE
SQL_TXN_ISOLATION_OPTION 0
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.
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
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
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.
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
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.
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.
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
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_CURRENT_QUALIFIER Supported.
SQL_OPT_TRACE Supported.
SQL_OPT_TRACEFILE Supported.
NOTE
This topic provides Excel Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
COLUMN COMMENTS
INDEX_NAME Index-dependent.
SEQ_IN_INDEX Index-dependent.
COLUMN_NAME Index-dependent.
COLLATION Index-dependent.
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
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.
SzTableType For Microsoft Excel 3.0 or 4.0, "TABLE" is the only table type
supported.
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, 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
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
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.
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.
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.
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.
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
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.
BYTES If you insert NULL into a binary column with the Paradox5
driver, it is changed to 0.
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.
SQL_ACCESSIBLE_PROCEDURES "N"
SQL_ACCESSIBLE_TABLES "Y"
SQL_ACTIVE_ENVIRONMENTS 0
SQL_ALTER_DOMAIN 0
SQL_ASYNC_MODE 0
SQL_BATCH_ROW_COUNT 0
SQL_BATCH_SUPPORT 0
SQL_CATALOG_LOCATION SQL_QL_START
SQL_CATALOG_NAME "Y"
SQL_CATALOG_NAME_SEPARATOR "\"
SQL_CATALOG_TERM "Directory"
SQL_COLLATION_SEQ ""
SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE
SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL
SQL_CONVERT_BIGINT 0
SQL_CONVERT_BIT 0
SQL_CONVERT_DECIMAL 0
SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT
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_DATETIME_LITERALS 0
SQL_DBMS_NAME "PARADOX"
SQL_DEFAULT_TXN_ISOLATION 0
SQL_DESCRIBE_PARAMETER 0
SQL_DRIVER_NAME "OdbcJt32.dll"
SQL_DRIVER_ODBC_VER "3.51.0000"
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_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT
SQL_IDENTIFIER_CASE SQL_IC_MIXED
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_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_ODBC_SQL_INTEGRITY "N"
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_SEARCH_PATTERN_ESCAPE "\"
SQL_SERVER_NAME "PARADOX"
SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"
SQL_SYSTEM_FUNCTIONS 0
SQL_TABLE_TERM "TABLE"
SQL_TIMEDATE_ADD_INTERVALS 0
SQL_TIMEDATE_DIFF_INTERVALS 0
SQL_TXN_CAPABLE SQL_TC_NONE
SQL_TXN_ISOLATION_OPTION 0
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.
NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
ATTRIBUTE COMMENTS
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
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
26 (Paradox 3.x)
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.
This sets the same option as User Name 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.
KEYWORD DESCRIPTION
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.
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
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_CURRENT_QUALIFIER Supported.
SQL_OPT_TRACE Supported.
SQL_OPT_TRACEFILE Supported.
NOTE
This topic provides Paradox Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
COLUMN COMMENTS
INDEX_NAME Index-dependent.
SEQ_IN_INDEX Index-dependent.
COLUMN_NAME Index-dependent.
COLLATION Index-dependent.
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
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.
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:
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
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
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.
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.
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.
CHAR SQL_VARCHAR
DATE SQL_DATE
FLOAT[1] SQL_DOUBLE
LOGICAL SQL_BIT
MEMO SQL_LONGVARCHAR
OLEOBJECT[1] SQL_LONGBINARY
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.
Encrypted data The dBASE driver does not support encrypted dBASE tables.
DATA TYPE DESCRIPTION
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.
SQL_ACCESSIBLE_PROCEDURES "N"
SQL_ACCESSIBLE_TABLES "Y"
SQL_ACTIVE_ENVIRONMENTS 0
SQL_ALTER_DOMAIN 0
SQL_ASYNC_MODE 0
SQL_BATCH_ROW_COUNT 0
SQL_BATCH_SUPPORT 0
SQL_CATALOG_LOCATION SQL_QL_START
SQL_CATALOG_NAME "Y"
SQL_CATALOG_NAME_SEPARATOR "\"
SQL_CATALOG_TERM "Directory"
SQL_COLLATION_SEQ ""
SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE
SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL
SQL_CONVERT_BIGINT 0
SQL_CONVERT_BIT 0
SQL_CONVERT_DECIMAL 0
SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT
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_DATETIME_LITERALS 0
SQL_DBMS_NAME "DBASE"
SQL_DEFAULT_TXN_ISOLATION 0
SQL_DESCRIBE_PARAMETER 0
SQL_DRIVER_NAME "OdbcJt32.dll"
SQL_DRIVER_ODBC_VER "3.51.0000"
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_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT
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_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_ODBC_SQL_INTEGRITY "N"
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_SEARCH_PATTERN_ESCAPE "\"
SQL_SERVER_NAME "DBASE"
SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"
SQL_SYSTEM_FUNCTIONS 0
SQL_TABLE_TERM "TABLE"
SQL_TIMEDATE_ADD_INTERVALS 0
SQL_TIMEDATE_DIFF_INTERVALS 0
SQL_TXN_CAPABLE SQL_TC_NONE
SQL_TXN_ISOLATION_OPTION 0
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.
NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
ATTRIBUTE COMMENTS
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
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
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.
21 (dBASE III)
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.
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.
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
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_CURRENT_QUALIFIER Supported.
SQL_OPT_TRACE Supported.
SQL_OPT_TRACEFILE Supported.
NOTE
This topic provides dBASE Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
COLUMN COMMENTS
INDEX_NAME Index-dependent.
SEQ_IN_INDEX Index-dependent.
COLUMN_NAME Index-dependent.
COLLATION Index-dependent.
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
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.
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
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.
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.
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.
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.
FLOAT The maximum width includes the sign and decimal point. In
Schema.ini, the width is denoted as follows:
0 is INTEGER Width 1
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.
SQL_ACCESSIBLE_PROCEDURES "N"
SQL_ACCESSIBLE_TABLES "Y"
SQL_ACTIVE_ENVIRONMENTS 0
SQL_ALTER_DOMAIN 0
SQL_ALTER_TABLE 0
SQL_ASYNC_MODE 0
SQL_BATCH_ROW_COUNT 0
SQL_BATCH_SUPPORT 0
SQL_CATALOG_LOCATION SQL_QL_START
SQL_CATALOG_NAME "Y"
SQL_CATALOG_NAME_SEPARATOR "\"
SQL_CATALOG_TERM "Directory"
SQL_COLLATION_SEQ ""
SQL_COLUMN_ALIAS "Y"
INFOTYPE RETURNED VALUE
SQL_CONCAT_NULL_BEHAVIOR SQL_CB_NON_NULL
SQL_CONVERT_BIGINT 0
SQL_CONVERT_BIT 0
SQL_CONVERT_DECIMAL 0
SQL_CONVERT_FUNCTIONS SQL_FN_CVT_CONVERT
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_READ_ONLY "Y"
SQL_DATETIME_LITERALS 0
SQL_DBMS_NAME "TEXT"
Version: 1.0
SQL_DDL_INDEX 0
SQL_DEFAULT_TXN_ISOLATION 0
SQL_DESCRIBE_PARAMETER 0
SQL_DRIVER_NAME "OdbcJt32.dll"
SQL_DRIVER_ODBC_VER "3.51.0000"
INFOTYPE RETURNED VALUE
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_GROUP_BY SQL_GB_GROUP_BY_CONTAINS_SELECT
SQL_IDENTIFIER_CASE SQL_IC_MIXED
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_ODBC_SQL_INTEGRITY "N"
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_SEARCH_PATTERN_ESCAPE "\"
SQL_SERVER_NAME "TEXT"
SQL_SPECIAL_CHARACTERS "~`@#$%^&*_-+=\}{"';:?/><,.!'[]|"
SQL_SYSTEM_FUNCTIONS 0
SQL_TABLE_TERM "TABLE"
SQL_TIMEDATE_ADD_INTERVALS 0
SQL_TIMEDATE_DIFF_INTERVALS 0
SQL_TXN_CAPABLE SQL_TC_NONE
SQL_TXN_ISOLATION_OPTION 0
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.
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.
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.
Modify Modifies the selected column using the values in Data Type,
Name, and Width.
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.
Tables Contains a list of all files in the directory selected in the Text
Setup dialog box that match the list of extensions specified.
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.
[Sample.txt]
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( )
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:
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.
Bit
Byte
Short
Long
Currency
Single
Double
DateTime
Text
Memo
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).
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.
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.
CurrencyDigits Specifies the number of digits used for the fractional part of a
currency amount.
- ($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
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
NOTE
The width of each column in a fixed-width text file is specified in the Schema.ini file.
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.
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
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
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
COLNAMEHEADER For the Text driver, indicates whether the first record of data
will specify the column names. Either TRUE or FALSE.
EXTENSIONS Lists the file name extensions of the Text files on the data
source.
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.)
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.
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
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_CURRENT_QUALIFIER Supported.
SQL_OPT_TRACE Supported.
SQL_OPT_TRACEFILE Supported.
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
INDEX_NAME Index-dependent.
SEQ_IN_INDEX Index-dependent.
COLUMN_NAME Index-dependent.
COLLATION Index-dependent.
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
NOTE
This topic provides Text File Driver-specific information. For general information about this function, see the appropriate topic
under ODBC API Reference.
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:
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:
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 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.
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:
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:
LIKE Predicate
NOT NULL
ORDER BY Clause
Table Name
Table References
Views
WHERE 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:
All data types Type conversion failures might result in the affected column
being set to NULL.
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.
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
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
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
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
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
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
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:
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").
SQLBindPara Excel
meter
SQLProcedure Access
Columns
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
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_OWNER NULL
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
FOPTION COMMENTS
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).
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.
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.
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:
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:
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.
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:
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:
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.
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.
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.
SQL_CONCURRENCY 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.
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.
SQL_CURSOR_FORWARD_ONLY SQL_CONCUR_READ_ONLY
SQL_CURSOR_STATIC SQL_CONCUR_READ_ONLY
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.
CatalogCap 2 1 0 or 1 If 1, nonquoted
identifiers will be
converted to
uppercase in the
catalog functions.
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.
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
PROCEDURE proc1
(
o_id OUT t_id,
ao_course OUT t_Course,
ao_dept OUT t_Dept
);
END SimplePackage;
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;
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:
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:
Exp Pi sin
Date functions:
String functions:
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.
SQLBindCol Assigns storage space for a result column and specifies the
type of the result.
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
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.
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.
SQLFreeEnv Closes the ODBC Driver for Oracle and releases all memory
associated with the driver.
SQLGetCursorName Returns the name of the cursor associated with the given
hstmt.
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.
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.
SQLGetData Retrieves the value of a single field in the current record of the
given 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.
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.
SQLPrimaryKeys Returns the column names that comprise the primary key
for a table.
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.
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.
CHAR SQL_CHAR
DATE SQL_TIMESTAMP
FLOAT SQL_DOUBLE
INTEGER SQL_DECIMAL
LONG SQL_LONGVARCHAR
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
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:
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.
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.
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:
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:
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
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
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.
Microsoft Access, Microsoft Excel, or Microsoft Word Accessing Visual FoxPro Data from Microsoft Office
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
2 - Snapshot
customer
6. Change the DataSource property for the text box to the default name for the Data control to the following:
data1
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>
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");
}
rc = SQLAllocStmt(hdbc, &hstmt);
}
// 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);
}
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
Use Microsoft Excel Accessing a Visual FoxPro Data Source from Microsoft Excel
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.
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.
SET PROCEDURE Command SET RELATION Command SET RELATION OFF Command
WEEK( ) Function
YEAR( ) Function
ZAP Command
Supported ODBC SQL Grammar (Visual FoxPro
ODBC Driver)
12/20/2017 • 1 min to read • Edit Online
Minimum Data Definition Language (DDL) CREATE TABLE and DROP TABLE
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.
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.
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.
Exclusive Yes or No
BackgroundFetch Yes or No
VALUE NAME (KEYWORD) VALUE TYPE VALUE
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.
INSERT (string_exp1, start, length, string_exp2) STUFF (string_exp1, start, length, string_exp2)
LTRIM (string_exp)
RTRIM (string_exp)
SOUNDEX (string_exp)
SPACE (count )
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.
ABS (numeric_exp)
ACOS (float_exp)
ASIN (float_exp)
ATAN (float_exp)
CEILING (numeric_exp)
COS (float_exp)
COT (float_exp)
EXP (float_exp)
FLOOR (numeric_exp)
LOG (float_exp)
LOG10 (float_exp)
PI ( )
RAND ([integer_exp])
SIGN (numeric_exp)
SIN (float_exp)
SQRT (float_exp)
ODBC GRAMMAR VISUAL FOXPRO GRAMMAR
TAN (float_exp)
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.
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)
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.
#DEFINE ... #UNDEF #IF ... #ENDIF Preprocessor Directive #IFDEF | #IFNDEF
#INCLUDE Preprocessor Directive :: Scope Resolution Operator ! Command (see RUN | ! Command)
@ ... EDIT - Edit Boxes Command @ ... FILL Command @ ... GET
_BROWSER System Memory Variable BUILD APP Command BUILD EXE Command
_CALCVALUE System Memory Variable _CLIPTEXT System Memory Variable _CONVERTER System Memory Variable
CREATE SCREEN Command CREATE SQL VIEW Command CREATE TRIGGER Command
_DBLCLICK System Memory Variable _DIARYDATE System Memory Variable DBSETPROP( ) Function
_FOXDOC System Memory Variable _FOXGRAPH System Memory Variable FEOF( ) Function
_GENGRAPH System Memory Variable _GENMENU System Memory Variable _GENPD System Memory Variable
_GENSCRN System Memory Variable _GENXTAB System Memory Variable GETBAR( ) Function
JOIN Command
KEYBOARD Command
NUMLOCK( ) 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
QUIT Command
SET COLOR OF SCHEME Command SET COLOR SET Command SET COLOR TO Command
SET STATUS Command SET STATUS BAR Command SET STEP Command
SET TALK Command SET TEXTMERGE Command SET TEXTMERGE DELIMITERS Command
SET TYPEAHEAD Command SET VIEW Command SET WINDOW OF MEMO Command
SET XCMDFILE Command _SHELL System Memory Variable SHOW GET Command
_TABS System Memory Variable TEXT ... ENDTEXT Command TXTWIDTH( ) Function
_WINDOWS System Memory Variable _WIZARD System Memory Variable WCHILD( ) Function
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.
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.
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
99 Procedure canceled.
100
127 You must use a logical expression with a FOR or WHILE clause.
133 Index does not match the table. Delete the index file and re-
create the index.
180 File was not placed in memory using the LOAD command.
200
400
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.
495 Warning: The key defined by the KeyField property for table
value is not unique.
500
542 Base table fields have been changed and no longer match view
fields. View field properties cannot be set.
547 Cannot insert an empty row from a view into its base table(s).
600
624 Menu title has not been defined with DEFINE PAD.
659 The table has memo fields that cannot be converted while
open read-only.
700
750 File was created in a later version of Visual FoxPro than the
current version.
784 This object is derived from a base class and does not have a
parent class.
800
900
935 The current object does not inherit from class value.
990 Cancel.
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.
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.
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.
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.
SQLAllocConnect SQLExecute
SQLAllocEnv SQLFetch
SQLAllocStmt SQLFreeConnect
SQLBindCol SQLFreeEnv
SQLCancel SQLFreeStmt
SQLColAttributes SQLGetCursorName
SQLConnect SQLNumResultCols
SQLDescribeCol SQLPrepare
SQLDisconnect SQLRowCount
SQLError SQLSetCursorName
SQLExecDirect SQLTransact
SQLBindParameter SQLGetTypeInfo
SQLColumns SQLParamData
SQLDriverConnect SQLPutData
SQLGetConnectOption SQLSetConnectOption
SQLGetData SQLSetStmtOption
SQLGetFunctions SQLSpecialColumns
SQLGetInfo SQLStatistics
SQLGetStmtOption SQLTables
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
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.
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.
Description
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.
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:
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_TXN_READ_UNCOMMITTED
SQL_TXN_REAPEATABLE_READ
SQL_TXN_SERIALIZABLE
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
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
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.
SQL_BIT Logical
SQL_CHAR Character
SQL_DATE Date
SQL_DECIMAL Numeric
SQL_DOUBLE Double
SQL_FLOAT Double
SQL_INTEGER Integer
SQL_LONGVARCHAR Memo
SQL_REAL Double
SQL_SMALLINT Integer
SQL_TIMESTAMP DateTime
SQL_TINYINT Integer
ODBC TYPE VISUAL FOXPRO TYPE
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:
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_TXN_READ_UNCOMMITTED
SQL_TXN_REAPEATABLE_READ
SQL_TXN_SERIALIZABLE
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.
SQL_KEYSET_SIZE Error: "Driver not capable" Visual FoxPro does not support the
keyset cursor model.
SQL_NOSCAN SQL_NOSCAN_OFF
FOPTION ALLOWED VALUES COMMENTS
SQL_ROWSET_SIZE 1 to 4,294,967,296
SQL_USE_BOOKMARKS SQL_UB_OFF
SQL_UB_ON
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.
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
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)
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
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.
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.
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
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
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.
DROP TABLE base-table-name Database (.dbc file) REMOVE TABLE TableName DELETE
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.
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
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
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
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 ;
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 ;
orders.postalcode)
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 ;
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:
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 ("").
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
ICELAND Icelandic
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:
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:
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
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.)
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
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.
B - d Double
D - - Date
G - - General
I - - Integer
L - - Logical
M - - Memo
T - - DateTime
Y - - Currency