Re: [Haskell-cafe] HDBC with SQL Server / OBDC

2008-05-29 Thread Andrew Appleyard
On Wed, May 28, 2008 at 12:46 AM, Olivier Boudry
[EMAIL PROTECTED] wrote:
 If the calling convention is stdcall on Windows and ccall on other OS then
 it should be defined based on the OS. This can be done by updating the .hsc
 files to define the calling convention as a macro depending on the OS
 type.

 #ifdef mingw32_HOST_OS
 #let CALLCONV = stdcall
 #else
 #let CALLCONV = ccall
 #endif

 And the foreign import should use CALLCONV instead of ccall.

 This should make it work on Windows and not break it on Linux.

Thanks Olivier, that's neater than I thought.  I'll put a patch together.

-- Andrew
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] HDBC with SQL Server / OBDC

2008-05-25 Thread Morten Holm Pedersen
am trying to do a simple DB connection from Haskell to a SQL Server 2005 
(on Windows obviously). The DSN name (Nylon) works from C++ but when 
running the below example (or any other I can think of) ghci crashes.
Does anyone know a resolution for this or where the problem can possible 
be ?



GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude :m Database.HDBC
Prelude Database.HDBC :m + Database.HDBC.ODBC
Prelude Database.HDBC Database.HDBC.ODBC  do { conn - connectODBC 
DSN=Nylon; xs - getTables conn; putStr $ head xs; }

Loading package array-0.1.0.0 ... linking ... done.
Loading package containers-0.1.0.1 ... linking ... done.
Loading package bytestring-0.9.0.1 ... linking ... done.
Loading package old-locale-1.0.0.0 ... linking ... done.
Loading package old-time-1.0.0.0 ... linking ... done.
Loading package mtl-1.1.0.0 ... linking ... done.
Loading package HDBC-1.1.4 ... linking ... done.
Loading package HDBC-odbc-1.1.4.3 ... linking ... done.
CRASH !!!




Thanks
Morten


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] HDBC with SQL Server / OBDC

2008-05-25 Thread Greg Matheson
On Sun, 25 May 2008, Morten Holm Pedersen wrote:

 am trying to do a simple DB connection from Haskell to a SQL Server 2005 
 (on Windows obviously). The DSN name (Nylon) works from C++ but when 
 running the below example (or any other I can think of) ghci crashes.

I have been having the same (or similar) problem with HDBC and 
SQL Server. I have no problem using HDBC and SQLite on Windows, 
and also have no problems with perl's DBI and DBD::ODBC 
connecting to the SQL Server database with the same DSN.

But I don't know where to point the finger, and I don't know what 
to do next. It does seem strange that there is no error message 
when ghci crashes.

-- 
Dr Bean  Autonomous language learning:
 My next project after overseeing
 the making of laborers into athletes.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe