Created
July 21, 2010 16:14
-
-
Save jacobstanley/484695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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