|
|
| version 1.37, 2010/10/27 22:48:50 | version 1.40, 2012/06/06 14:50:09 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser ODBC driver. | Parser ODBC driver. |
| Copyright(c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| static const char *RCSId="$Id$"; | |
| #ifndef _MSC_VER | #ifndef _MSC_VER |
| # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] | # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] |
| Line 21 static const char *RCSId="$Id$"; | Line 20 static const char *RCSId="$Id$"; |
| #define WINVER 0x0400 | #define WINVER 0x0400 |
| #include <AFXDB.H> | #include <AFXDB.H> |
| volatile const char * IDENT_PARSER3ODBC_C="$Id$" IDENT_PA_SQL_DRIVER_H; | |
| // defines | // defines |
| #define MAX_COLS 500 | #define MAX_COLS 500 |
| Line 531 private: | Line 532 private: |
| result.limit=true; | result.limit=true; |
| result.statement=statement_limited; | result.statement=statement_limited; |
| snprintf(statement_limited, MAX_NUMBER+11, "SELECT TOP %u", (limit)?limit+offset:0/*no point to skip anything if we need 0 rows*/); | snprintf(statement_limited, MAX_NUMBER+11, "SELECT TOP %lu", (limit)?limit+offset:0/*no point to skip anything if we need 0 rows*/); |
| astatement+=6;/*skip 'select'*/ | astatement+=6;/*skip 'select'*/ |
| strcat(statement_limited, astatement); | strcat(statement_limited, astatement); |
| Line 554 private: | Line 555 private: |
| result.offset=true; | result.offset=true; |
| result.statement=statement_limited; | result.statement=statement_limited; |
| statement_limited+=snprintf(statement_limited, MAX_NUMBER+15, "SELECT FIRST (%u)", limit); | statement_limited+=snprintf(statement_limited, MAX_NUMBER+15, "SELECT FIRST (%lu)", limit); |
| if(offset && limit/*no reasons to skip something if we need 0 rows*/) | if(offset && limit/*no reasons to skip something if we need 0 rows*/) |
| statement_limited+=snprintf(statement_limited, MAX_NUMBER+8, " SKIP (%u)", offset); | statement_limited+=snprintf(statement_limited, MAX_NUMBER+8, " SKIP (%lu)", offset); |
| astatement+=6;/*skip 'select'*/ | astatement+=6;/*skip 'select'*/ |
| strcat((char*)result.statement, astatement); | strcat((char*)result.statement, astatement); |
| Line 584 private: | Line 585 private: |
| void _throw(Connection& connection, long value){ | void _throw(Connection& connection, long value){ |
| char msg[MAX_STRING]; | char msg[MAX_STRING]; |
| snprintf(msg, MAX_STRING, "%u", value); | snprintf(msg, MAX_STRING, "%lu", value); |
| connection.services->_throw(msg); | connection.services->_throw(msg); |
| } | } |