When you send data from a Microsoft Jet client to a remote data source, the Microsoft Jet engine must find an appropriate ODBC data type to receive the data. This data type mapping can involve rather complex decisions for Microsoft Jet because many database servers implement only a subset of the ODBC data types. Therefore, Microsoft Jet tries a prioritized list of data types and maps the local data to the first data type supported on the remote data source. Note that some Microsoft Jet data types are unsupported on some database servers.
Microsoft Jet data type | ODBC data type |
Yes/No (Boolean) |
SQL_BIT SQL_SMALLINT SQL_INTEGER SQL_VARCHAR(5) |
Number (Byte) |
SQL_SMALLINT SQL_INTEGER SQL_VARCHAR(10) |
Number (Integer) |
SQL_SMALLINT SQL_INTEGER SQL_VARCHAR(10) |
Number (Long Integer) |
SQL_INTEGER SQL_VARCHAR(20) |
Currency |
SQL_DECIMAL(19,4) (Microsoft SQL Server and Sybase SQL Server only) SQL_FLOAT SQL_VARCHAR(30) |
Number (Single) |
SQL_REAL SQL_FLOAT SQL_VARCHAR(30) |
Number (Double) |
SQL_FLOAT SQL_VARCHAR(40) |
DateTime |
SQL_TIMESTAMP SQL_VARCHAR(40) |
Text (fieldsize) | SQL_VARCHAR(n), where n is the smaller of the Microsoft Jet field size and the database server’s maximum size for a VARCHAR. |
Binary (fieldsize) |
SQL_VARBINARY(n), where n is the smaller of the Microsoft Jet field size and the database server’s maximum size for a VARBINARY. If SQL_VARBINARY is not supported on the database server, the query fails. |
Memo |
SQL_LONGVARCHAR if the server supports it. Otherwise, SQL_VARCHAR(n), where n is the server’s maximum size for a VARCHAR if the maximum size is greater than 2000. If neither case is supported on the database server, the query fails. |
Long Binary (OLE Object) |
SQL_LONGVARBINARY if the server supports it. Otherwise, SQL_VARBINARY (n), where n is the database server’s maximum size for a VARBINARY if the maximum size is greater than 2000. If neither case is supported on the database server, the query fails. |