Skip to content

Instantly share code, notes, and snippets.

@jacobstanley
Created July 21, 2010 16:14
Show Gist options
  • Save jacobstanley/484695 to your computer and use it in GitHub Desktop.
Save jacobstanley/484695 to your computer and use it in GitHub Desktop.
On Ubuntu 10.04:
> runghc HDBC-Ubuntu.hs
HDBC-Ubuntu.hs: Prelude.(!!): index too large
On Windows XP:
> runghc HDBC-Windows.hs
HDBC-Windows.hs: Prelude.(!!): index too large
import Database.HDBC
import Database.HDBC.ODBC
main = do
conn <- connectODBC connectionStr
vals <- getTables conn
print vals
connectionStr = "\
\Driver=FreeTDS;\
\SERVER=1.1.1.15;\
\Port=1433;\
\Database=MyDatabase;\
\UID=sa;\
\PWD=sa;\
\TDS_Version=7.0;"
import Database.HDBC
import Database.HDBC.ODBC
main = do
conn <- connectODBC connectionStr
vals <- getTables conn
print vals
connectionStr = "\
\Driver={SQL Server};\
\SERVER=1.1.1.15;\
\Port=1433;\
\Database=MyDatabase;\
\UID=sa;\
\PWD=sa;\
\TDS_Version=7.0;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment