View Single Post

   
  #3 (permalink)  
Old 02-27-2008, 05:42 AM
Mark Yudkin
 
Posts: n/a
Default Re: SetConnectAttr ODBC

The third parameter is the value, not a pointer to the value. Your use of an
explicit cast to force the wrong value prevents the compiler from telling
you that your code is wrong, so you get told off at runtime.

<ajay978@gmail.com> wrote in message
news:1135931348.004449.284520@f14g2000cwb.googlegr oups.com...
> Hi,
> I am trying to call SQLSetConnectAttr api but I am getting following
> error:
> SQLSTATE: HY024
> Native: -99999
> Message: [IBM][CLI Driver] CLI0191E Invalid attribute value.
> SQLSTATE=HY024
>
> I have created connection successfully but whiling setting connection
> autocommit mode to false I am getting above error.
>
> SQLUINTEGER autocommit;
> autocommit = SQL_AUTOCOMMIT_OFF;
> rc = SQLSetConnectAttr( hdbc, SQL_ATTR_AUTOCOMMIT, (void
> *)&autocommit, 0);
>
> Could some pls help ?
>
> Regards
> Ajay
>



Reply With Quote