Re: ext/odbc no longer builds under VC6
[email protected] (Patrick van Kleef)
| Newsgroups | php.internals.win |
|---|---|
| Message-ID | <[email protected]> |
Hi Steph, > > 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.) > No, the 32bit ODBC specification is backward compatible all the way back to Windows NT which came before Windows 2000. In the ODBC API specification, there are certain fields that needed either a pointer or an integer value or a length of a blob. Since Microsoft 64 bit OS has both integer and long defined as 32 bit quantities, they added a new typedef called SQLLEN which is a 64bit quantity on 64 bit Windows, but a normal 32 bit quantity on 32 bit windows. So these changes have nothing to do with dropping support for earlier versions of Windows. >> 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. > The compiler package would probably also have installed a version of the Platform SDK, but these have always been separately maintained and downloadable through the Microsoft download site. In the past you did not need a genuine windows certificate in order to download any of these. Did you check if there was any SP1 package for your version of the compiler? >> Thirdly, the version of the ODBC API (3.51) that i uses as a base >> for these patches has been around for some 5 years, and is >> available on all modern platforms including Windows, Unix, Linux >> and Mac OS X. > > Version 3.51 is available in the version of MSVC++ 6.0 I have > installed. It doesn't define SQLLEN or SQLULEN. The extension > redefines the version to 2.50 in two places, but out-commenting > those lines makes no difference because the actual definitions are > missing from the header. (I've out-commented them here anyway for > now.) > These types never existed in ODBC 2.5 and 3.0 and my official Microsoft 3.0 Programmers reference books has no mention of them. I believe the problem is that Microsoft put these defines into ODBC 3.51 release and have some official Microsoft headers from around 2000 which already have the SQLLEN inside sqltypes.h. At some point they added some other new typedefs, but these where removed when they officially synced the API with the SAG group. It could be they first started with an internal 3.50 version and moved to 3.51 when they synced with SAG, but i have no definite proof of this. By this time Microsoft already tried to steer everyone away from ODBC and tried to windows programmers to OLEDB to keep them locked to the windows platform. My company and others had already successfully ported the ODBC specification to non windows platforms. In any case, since they did not change anything for 32bit ODBC use, they might have thought they did not really need to change the ODBCVER setting to reflect a major change in the API. I cannot explain why you got header files that use ODBCVER 0x0351 but have no mention of SQLLEN and SQLULEN. You may need to ask Microsoft about this. I would also make sure there is no update for your compiler. >> I am guessing you are using a very old version of either of these >> packages on your machine. Or you may have still a very old sql.h >> or sqltype.h file installed somewhere in front of your include >> path. Or as a last option, you may have defined ODBCVER to 0x0250 >> or 0x0300 before including the sql.h file maybe in your VC >> project file. > > I find it difficult to believe they upgraded the API without > bumping the version number. Can you confirm that you're using 3.51 > and not, say, 3.52? > I just checked my brand new visual studio 2008 installation and the Platform SDK it installed still says ODBCVER 0x0351. >> However i would like to make clear that without using this ODBC >> 3.51 API, it will be impossible for PHP to move into the 64bit >> windows realms without loosing major data connectivity. > > No, it's the Windows Server 2003 stuff we need. Which rather begs > the question, why didn't the 2003 SDK upgrade include this update? > > I have this working here with: > > #ifndef SQLLEN > #define SQLLEN SQLINTEGER > #define SQLULEN SQLUINTEGER > #endif > That is all that should be needed on 32bit, but if you where to try and use these settings with the 64bit compiler, you would get some serious crashes, so i need to check > 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? As far as i know was using MDAC 2.8 SP1 on my previous development box, but i will check to make sure. Patrick