]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/db.cpp
avoiding nesting dcs on the same window concurrently
[wxWidgets.git] / src / common / db.cpp
index d0b9bf6499d737cbef616da81d63cd464297270f..a43f461158e5473c0f0c64c5dc2ff55548314883 100644 (file)
@@ -858,7 +858,7 @@ bool wxDb::Open(const wxString& inConnectStr, SQLHWND parentWnd, bool failOnData
 
     retcode = SQLDriverConnect(hdbc, parentWnd, (SQLTCHAR FAR *)inConnectionStr.c_str(),
                         (SWORD)inConnectionStr.length(), (SQLTCHAR FAR *)outConnectBuffer,
-                        sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE );
+                        WXSIZEOF(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE );
 
     if ((retcode != SQL_SUCCESS) &&
         (retcode != SQL_SUCCESS_WITH_INFO))
@@ -920,7 +920,7 @@ bool wxDb::Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported)
 
     // Use the connection string if one is present
     if (dbConnectInf->UseConnectionStr())
-        return Open(GetConnectionInStr(), failOnDataTypeUnsupported);
+        return Open(dbConnectInf->GetConnectionStr(), failOnDataTypeUnsupported);
     else
         return Open(dbConnectInf->GetDsn(), dbConnectInf->GetUserID(),
                     dbConnectInf->GetPassword(), failOnDataTypeUnsupported);
@@ -963,7 +963,7 @@ bool wxDb::Open(wxDb *copyDb)
 
         retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(),
                             (SWORD)inConnectionStr.length(), (SQLTCHAR FAR *)outConnectBuffer,
-                            sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE);
+                            WXSIZEOF(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE);
 
         if ((retcode != SQL_SUCCESS) &&
             (retcode != SQL_SUCCESS_WITH_INFO))
@@ -1755,8 +1755,9 @@ void wxDb::Close(void)
         tiu = (wxTablesInUse *)pNode->GetData();
         if (tiu->pDb == this)
         {
-            s.Printf(wxT("(%-20s)     tableID:[%6lu]     pDb:[%p]"), tiu->tableName,tiu->tableID,tiu->pDb);
-            s2.Printf(wxT("Orphaned table found using pDb:[%p]"),this);
+            s.Printf(wxT("(%-20s)     tableID:[%6lu]     pDb:[%p]"),
+                     tiu->tableName, tiu->tableID, wx_static_cast(void*, tiu->pDb));
+            s2.Printf(wxT("Orphaned table found using pDb:[%p]"), wx_static_cast(void*, this));
             wxLogDebug(s.c_str(),s2.c_str());
         }
         pNode = pNode->GetNext();