]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/odbc.cpp
fixed bug in parsing filenames without paths, added more/better tests
[wxWidgets.git] / src / common / odbc.cpp
index de925cc2eac3020284b105308aefc55ed408c1b2..bdf71719d7dd81adf4de93523c338b547bc29148 100644 (file)
@@ -2,12 +2,12 @@
 // Name:        odbc.cpp
 // Purpose:     ODBC implementation
 // Author:      Julian Smart, Olaf Klein (oklein@smallo.ruhr.de),
-//               Patrick Halke (patrick@zaphod.ruhr.de)
-// Modified by:        
+//              Patrick Halke (patrick@zaphod.ruhr.de)
+// Modified by:
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
-// Licence:    wxWindows license
+// Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
 
 #include "wx/defs.h"
 
-#if USE_ODBC
+// this code is old and shouldn't be used - use the new ODBC classes in db.cpp
+// and dbtable.cpp instead
+#define wxUSE_OLD_ODBC 0
+
+#if wxUSE_OLD_ODBC
+
+#ifdef __VISUALC__
+    #pragma warning(disable:4706)   // assignment within conditional expression
+#endif // VC++
 
 #ifndef WX_PRECOMP
 #include "wx/utils.h"
 HENV wxDatabase::hEnv = 0;
 int wxDatabase::refCount = 0;
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxDatabase, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxQueryCol, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxQueryField, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxRecordSet, wxObject)
-#endif
 
 wxDatabase::wxDatabase(void)
 {
@@ -439,7 +445,7 @@ float wxDatabase::GetODBCVersionFloat(bool implementation)
   if (retcode == SQL_ERROR)
     return 0.0;
   else
-    return atof(buf);
+    return (float)atof(buf);
 }
 
 /*
@@ -614,7 +620,7 @@ bool wxRecordSet::GetResultSet(void)
     field1->SetType(type);
     field1->SetSize(len);
     
-    SQLBindCol(hStmt, i+1, SQL_C_BINARY, field1->GetData(), field1->GetSize(), &trash);
+    SQLBindCol(hStmt, i+1, SQL_C_BINARY, (unsigned char*)field1->GetData(), field1->GetSize(), &trash);
   }
   
   switch (type) {
@@ -1827,4 +1833,8 @@ bool wxQueryField::IsDirty(void) {
   return dirty;
 }
 
-#endif // USE_ODBC
+#ifdef __VISUALC__
+    #pragma warning(default:4706)   // assignment within conditional expression
+#endif // VC++
+
+#endif // wxUSE_OLD_ODBC