[unixODBC-dev] Issue with ODBC on 64 bit machine while using SQLUINTEGER and SQLINTEGER

Nick Gorham nick.gorham at easysoft.com
Thu Mar 27 11:37:54 GMT 2008


Martin Evans wrote:

> qureshifaizan faiz wrote:
>
>> Hi nick,
>> Thanks for the reply.please find the attached sample code
>> along with the sample table description to give you a bit
>> of more sight.I am very grateful  for your interest in this
>> issue. Waiting for your reply,guys because this code
>> works in 32 bit machine iam not able to find the problem.
>> why it is not working on  a 64 bit machine.
>>
>> Regards,
>> Faizan
>
>
> How are you compiling your code? Perhaps your MySQL driver was 
> compiled with SIZEOF_LONG = 8 and your code is compiled with 
> SIZEOF_LONG=4 ! Only guessing as the unixODBC sql* header files test 
> SIZEOF_LONG but nothing is recorded in unixODBC itself to say how it 
> was compiled. That means you can compile unixODBC with SIZEOF_LONG = 
> 8, your driver with SIZEOF_LONG=4 and your app with SIZEOF_LONG=xx and 
> they won't work together.
>
> Martin

Yes, what Martin says is correct, but it should not be the problem here, 
as SQLINTEGER is always 4 bytes.

However, if the app, DM and driver are built in different ways then it 
will cause problems.

The newer releases of unixODBC allow the compile settings to be found by 
configure scripts using

    odbc_config --cflags

and by looking at the header created by the driver manager build 
unixodbc_conf.h

But if the driver is not built on that machine, there is no way of 
enforcing consistency

-- 
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org




More information about the unixODBC-dev mailing list