SQL_C_BLOB was getting #define'd incorrectly if there was not already a definition

The wxDb::Open() function that takes a wxDbConnectInf() now has a second optional parameter 'failOnDataTypeUnsupported' that defaults to TRUE to maintain current behavior.  This allows users to specify FALSE if they want to try to continue
Reformatting of some text, and removal of old commented out code


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2004-05-12 14:07:37 +00:00
parent dd5b579ceb
commit f3df29e3f6

View File

@@ -111,30 +111,21 @@ typedef UCHAR SQLTCHAR;
enum enumDummy {enumDum1}; enum enumDummy {enumDum1};
#ifndef SQL_C_BOOLEAN #ifndef SQL_C_BOOLEAN
#define SQL_C_BOOLEAN(datatype) (sizeof(datatype) == 1 ? SQL_C_UTINYINT : (sizeof(datatype) == 2 ? SQL_C_USHORT : SQL_C_ULONG)) #define SQL_C_BOOLEAN(datatype) (sizeof(datatype) == 1 ? SQL_C_UTINYINT : (sizeof(datatype) == 2 ? SQL_C_USHORT : SQL_C_ULONG))
//# define SQL_C_BOOLEAN (sizeof(int) == 2 ? SQL_C_USHORT : SQL_C_ULONG)
#endif #endif
#ifndef SQL_C_ENUM #ifndef SQL_C_ENUM
#define SQL_C_ENUM (sizeof(enumDummy) == 2 ? SQL_C_USHORT : SQL_C_ULONG) #define SQL_C_ENUM (sizeof(enumDummy) == 2 ? SQL_C_USHORT : SQL_C_ULONG)
#endif #endif
// NOTE: If SQL_C_BLOB is defined, and it is not SQL_C_BINARY, iODBC 2.x
// may not function correctly. Likely best to use SQL_C_BINARY direct
#ifndef SQL_C_BLOB #ifndef SQL_C_BLOB
#ifdef SQL_LONGVARBINARY #ifdef SQL_C_BINARY
#define SQL_C_BLOB SQL_LONGVARBINARY #define SQL_C_BLOB SQL_C_BINARY
#elif SQL_VARBINARY
#define SQL_C_BLOB SQL_VARBINARY
#endif #endif
#endif #endif
/*
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
*/
const int wxDB_PATH_MAX = 254; const int wxDB_PATH_MAX = 254;
WXDLLIMPEXP_DATA_ODBC(extern wxChar const *) SQL_LOG_FILENAME; WXDLLIMPEXP_DATA_ODBC(extern wxChar const *) SQL_LOG_FILENAME;
@@ -274,13 +265,13 @@ enum wxODBC_ERRORS
}; };
#ifndef MAXNAME #ifndef MAXNAME
#define MAXNAME 31 #define MAXNAME 31
#endif #endif
#ifndef SQL_MAX_AUTHSTR_LEN #ifndef SQL_MAX_AUTHSTR_LEN
// There does not seem to be a standard for this, so I am // There does not seem to be a standard for this, so I am
// defaulting to the value that MS uses // defaulting to the value that MS uses
#define SQL_MAX_AUTHSTR_LEN MAXNAME #define SQL_MAX_AUTHSTR_LEN MAXNAME
#endif #endif
class WXDLLIMPEXP_ODBC wxDbConnectInf class WXDLLIMPEXP_ODBC wxDbConnectInf
@@ -351,7 +342,6 @@ struct WXDLLIMPEXP_ODBC wxDbSqlTypeInfo
SWORD FsqlType; SWORD FsqlType;
long Precision; long Precision;
short CaseSensitive; short CaseSensitive;
// short MinimumScale;
short MaximumScale; short MaximumScale;
}; };
@@ -609,7 +599,7 @@ public:
// Data Source Name, User ID, Password and whether open should fail on data type not supported // Data Source Name, User ID, Password and whether open should fail on data type not supported
bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=TRUE); bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=TRUE);
bool Open(wxDbConnectInf *dbConnectInf); bool Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported=TRUE);
bool Open(wxDb *copyDb); // pointer to a wxDb whose connection info should be copied rather than re-queried bool Open(wxDb *copyDb); // pointer to a wxDb whose connection info should be copied rather than re-queried
void Close(void); void Close(void);
bool CommitTrans(void); bool CommitTrans(void);