Re: [INTERNALS-WIN] Re: ext/odbc no longer builds under VC6

[email protected] ("Pierre Joye")
Newsgroups php.internals.win
Message-ID <[email protected]>
On Sun, Dec 14, 2008 at 7:08 PM, Steph Fox <[email protected]> wrote:
> OK, going back to the public list.
>
>> First of all, my patches have been tested to work on VC6 (both 32 and
>> 64bit) before i released it to the PHP public.
>
> Right. Support for 64-bit ODBC came with Windows Server 2003 (see
> http://msdn.microsoft.com/en-us/library/ms716287(VS.85).aspx). Presumably
> that means we lose support for earlier versions if we move to this API? What
> about Windows 2000 Server, where do we stand with support for that these
> days?
>
> (NB we only dropped support for Windows 98 two years ago.)
>
>> Secondly, to my knowledge, the header files and libraries for  developing
>> ODBC enabled applications on Windows is not part of the  compiler itself but
>> of either the Platform SDK or the MDAC package  installed.
>
> I believe the odbc stuff was shipped with the compiler, but... whatever.

It is in the platform SDK. See below.

> It's not clear to me which MDAC package I should be downloading to get
> SQLLEN defined in the headers/libs. Do you know which you're using?


Here is what is in the sqltypes.h header (SDK 2003/02):

/* API declaration data types */
typedef unsigned char   SQLCHAR;
#if (ODBCVER >= 0x0300)
typedef signed char     SQLSCHAR;
typedef unsigned char   SQLDATE;
typedef unsigned char   SQLDECIMAL;
typedef double          SQLDOUBLE;
typedef double          SQLFLOAT;
#endif
typedef long            SQLINTEGER;
typedef unsigned long   SQLUINTEGER;

#ifdef _WIN64
typedef INT64           SQLLEN;
typedef UINT64          SQLULEN;
typedef UINT64          SQLSETPOSIROW;
#else
#define SQLLEN          SQLINTEGER
#define SQLULEN         SQLUINTEGER
#define SQLSETPOSIROW   SQLUSMALLINT
#endif

//For Backward compatibility
#ifdef WIN32
typedef SQLULEN			SQLROWCOUNT;
typedef SQLULEN			SQLROWSETSIZE;
typedef SQLULEN			SQLTRANSID;
typedef SQLLEN			SQLROWOFFSET;
#endif

I tested again using a fresh installed windows XP Pro, VC6 Enterprise
SP6, and the platform SDK 2003/02 without any other dependency (deps/
or php_builds/ are empty) and it compiles fine.

I can pack the include and lib directories from the SDK in a zip and
upload it somewhere if you need them.

Cheers,
--
Pierre

http://blog.thepimp.net | http://www.libgd.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.