473,379 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

SetConnectAttr ODBC

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

Dec 30 '05 #1
2 2725
aj*****@gmail.com wrote:
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);


You are calling the function with the wrong parameters, and the explicit
casts prevent your compiler from raising an error/warning. Try this:

rc = SQLSetConnectAttr(hdbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, 0);

p.s: As a general rule: if you need casts in your code, there is a high
chance that you have a problem in the code itself. (Of course, there are
exceptions to that rule.)

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Dec 30 '05 #2
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.

<aj*****@gmail.com> wrote in message
news:11**********************@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

Dec 30 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marco Aschwanden | last post by:
Hi - Win2000 - Python 2.3.3 - py2exe 0.5.0 - eGenix Comercial & Base Package I am developing an app using mxODBC. On the home page they say ...
3
by: Joe | last post by:
Python 2.4 Windows XP SP2 MS Access 2000 mx.ODBC 2.0.7 Problem data truncation occuring (here's the actual error message): mxODBC.Warning: ('01004', 5, ' String data, right truncated on...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
0
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong...
6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
4
by: Andreas Lauffer | last post by:
Can anyone tell me advantages / disadvantages of DataDirect Server Wire ODBC-driver? Any experiences? What about redistribution? Andreas Lauffer, easySoft. GmbH, Germany
3
by: Lauren Quantrell | last post by:
Maybe a dumb question - I'm new to ODBC. How do I install an Access ..mde file on a user's workstation and create the ODBC connection to the backend SQL Server database without having to go through...
2
by: Crazy Cat | last post by:
Hi all, I am having trouble getting linked Oracle 9 server in MS SQL Server 2005 Express to work properly. My machine is running Windows XP. The Microsoft and Oracle OLE DB Providers have...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.