[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    [Haskell-cafe] SQL select for HDBC.ODBC MSSQL driver
From:       Anakreontas <anakreonmejdi () gmail ! com>
Date:       2015-10-27 12:34:53
Message-ID: 70e108a5-7feb-41d4-a59c-58aa055e8e8c () googlegroups ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello.

I obtain a connection and try to execute a query on MSSQL server with HDBC
  c <- connectODBC "Driver={SQL 
Server};Server=.;Database=Pure_Local;Trusted_Connection=yes;"
  stm <- quickQuery c "select count(*) as cnt from X__FD" []


HDBC obtains the connection but the SQL query raises an exception with the 
following message:
SqlError {seState = "[\"25000\"]", seNativeError = -1, seErrorMsg = 
"disconnect: [\"0: [Microsoft][ODBC SQL Server Driver]Invalid transaction 
state\"]"}

No matter which statement I tried, I always get the "Invalid transaction 
state" message.



[Attachment #5 (text/html)]

<div dir="ltr">Hello.<div><br></div><div>I obtain a connection and try to execute a \
query on MSSQL server with HDBC</div><div><div class="prettyprint" style="border: 1px \
solid rgb(187, 187, 187); word-wrap: break-word; background-color: rgb(250, 250, \
250);"><code class="prettyprint"><div class="subprettyprint"><div \
class="subprettyprint">   c &lt;- connectODBC &quot;Driver={SQL \
Server};Server=.;Database=Pure_Local;Trusted_Connection=yes;&quot;</div><div \
class="subprettyprint">   stm &lt;- quickQuery c &quot;select count(*) as cnt from \
X__FD&quot; []</div><div><br></div></div></code></div><div><br></div>HDBC obtains the \
connection but the SQL query raises an exception with the following \
message:</div><div>SqlError {seState = &quot;[\&quot;25000\&quot;]&quot;, \
seNativeError = -1, seErrorMsg = &quot;disconnect: [\&quot;0: [Microsoft][ODBC SQL \
Server Driver]Invalid transaction state\&quot;]&quot;}</div><div><br></div><div>No \
matter which statement I tried, I always get the &quot;Invalid transaction \
state&quot; message.</div><div><br></div><div><br></div></div>



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic