HDBC-odbc-2.5.0.1: ODBC driver for HDBC

CopyrightCopyright (C) 2005 John Goerzen
LicenseBSD3
MaintainerJohn Goerzen <jgoerzen@complete.org>
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Database.HDBC.ODBC

Description

HDBC driver interface for ODBC 3.x

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

connectODBC :: String -> IO Connection Source #

Connect to an ODBC server.

For information on the meaning of the passed string, please see:

http://msdn2.microsoft.com/en-us/library/ms715433(VS.85).aspx

An example string is:

"DSN=hdbctest1"

This, and all other functions that use ODBC directly or indirectly, can raise SqlErrors just like other HDBC backends. The seErrorMsg field is specified as a String in HDBC. ODBC specifies this data as a list of strings. Therefore, this driver uses show on the data from ODBC. For friendly display, or handling of individual component messages in your code, you can use read on the seErrorMsg field in a context that expects [String].

Important note for MySQL users:

Unless you are going to use InnoDB tables, you are strongly encouraged to set

Option = 262144

in your odbc.ini (for Unix users), or to disable transaction support in your DSN setup for Windows users.

If you fail to do this, the MySQL ODBC driver will incorrectly state that it supports transactions. dbTransactionSupport will incorrectly return True. commit and rollback will then silently fail. This is certainly NOT what you want. It is a bug (or misfeature) in the MySQL driver, not in HDBC.

You should ignore this advice if you are using InnoDB tables.

setAutoCommit :: Connection -> Bool -> IO Bool Source #

Changes AutoCommit mode of the given connection. Returns previous value.