        Name: freetds15
     Purpose: Port of the FreeTDS ODBC driver version 1.5.20

This is the FreeTDS ODBC database driver which provides access to
Microsoft SQL Server and Sybase databases running on remote servers.
It is built on the FreeTDS 1.5.20 library in
Projects.Libraries.Database.FreeTDS1_5_20 and can be installed next to
the older FreeTDS 0.62.4 driver.

Compared with 0.62.4 it adds TDS protocol versions 7.2, 7.3 and 7.4, so
it works with SQL Server 2005 to 2022 and supports their newer types
(varchar(max), nvarchar, datetime2, date, time, datetimeoffset, xml,
bigint, etc.).


Limitations
-----------
o This build has no TLS (encryption) support. It can only connect to
  servers that do not force encryption. It cannot connect to Azure SQL
  and cannot use TDS 8.0 (strict encryption). The login password is
  sent with the weak TDS obfuscation, not encrypted.
o No thread safety and no MARS.
o No iconv: the client character sets are limited to the ones FreeTDS
  converts itself (ISO-8859-1, UTF-8 and UCS-2). Use ISO-8859-1.
o Wide (SQL...W) ODBC functions are not exported.
o Kerberos/GSSAPI and SSPI logins are not available; use SQL Server
  logins (or NTLM with Domain\User names).


Installation
------------
The driver directory contains the driver (freetds15) which should be
installed using ODBCMan.

The FreeTDS directory should be copied into your Choices directory as
Choices:FreeTDS and the freetds/conf file inside it configured. If you
already have Choices:FreeTDS from the 0.62.4 driver, change
"tds version" in it from 4.2 (or 8.0) to auto.

FreeTDS looks for its configuration in this order:

  1) the file named by the system variable FREETDSCONF
  2) freetds/conf in the directory named by the system variable FREETDS
  3) Choices:FreeTDS.freetds/conf


odbc/ini and odbcinst/ini files
-------------------------------
These files contain example entries for the odbc/ini and odbcinst/ini
files.

These files can be configured using ODBCMan but the entries supplied here
are to give you an idea of what is needed to get basic connectivity up
and running.

Set UnloadSafe to 1 so that !ODBC unloads the driver when the last
client disconnects.


Configuring
-----------
If your odbc/ini file contains the following:

---------------------------------------------------------------------
[ODBC Data Sources]
SQLServer   = SQL Server via FreeTDS 1.5

[SQLServer]
Name              = SQLServer
Description       = SQL Server via FreeTDS 1.5
Servername        = myserver
ServerType        = FreeTDS
Database          = master
Username          = 
Password          = 
Driver            = <ODBC$DriverDir>.freetds15.freetds
UnloadSafe        = 1
---------------------------------------------------------------------

Then the FreeTDS/conf file in the Choices:FreeTDS directory must have
an entry for the Servername (in this case 'myserver') as follows:

---------------------------------------------------------------------
[myserver]
	host = myserver.example.com
	port = 1433
	tds version = auto
---------------------------------------------------------------------

The Servername entry in the odbc/ini file relates to the entry in the
FreeTDS/conf file which then in turn specifies the actual server that
the database resides on.

If Servername has no entry in FreeTDS/conf, the driver uses it as the
host name or IP address, with Port (default 1433). Instead of Servername
you can also give Server (the host name) and Port directly in the DSN.
Either way no FreeTDS/conf entry is needed.

Set TDS_Version = 7.4 in the DSN (or "tds version = auto" in
FreeTDS/conf). With TDS 4.2, SQL Server refuses to send xml and Unicode
(nvarchar, ntext) columns (error 4004) and varchar is limited to 255
characters.

Username and Password are saved in the DSN by ODBCMan; DSNs saved by
earlier builds with UID and PWD are still read. A non-empty UID or PWD
in the connection string overrides them.

To log what the driver does, set "dump file" in FreeTDS/conf, or
DumpFile in the DSN, for example to <Wimp$ScrapDir>.freetds/log. The log
contains the login packet, including the password, so delete it after
use.


Building
--------
Requirements: Acorn C compiler
              Acorn libfile
              Acorn C library (32 bit)
              Rink
              TCPIPLibs (32 bit)
              iODBC 3.52.1 headers
              FreeTDS 1.5.20 libraries (tds32, replacements32 and
              tdsutils32 from Projects.Libraries.Database.FreeTDS1_5_20)

Build the three FreeTDS 1.5.20 libraries first, then this driver. Link
them in the order tds32, replacements32, tdsutils32. Rink writes its
scrap files to o.rinkAOFscrap, so the driver directory needs an o
directory (*CDir o) before linking.
TCPIPLibs and rink need to be available to compile this. The resulting
freetdsseg and freetdslnk files are placed into the driver shared
resource, !ODBC.drivers.freetds15
