+
+/********** wxDbLogExtendedErrorMsg() **********/
+// DEBUG ONLY function
+const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText, wxDb *pDb,
+ char *ErrFile, int ErrLine)
+{
+ static wxString msg;
+ msg = userText;
+
+ wxString tStr;
+
+ if (ErrFile || ErrLine)
+ {
+ msg += wxT("File: ");
+ msg += ErrFile;
+ msg += wxT(" Line: ");
+ tStr.Printf(wxT("%d"),ErrLine);
+ msg += tStr.c_str();
+ msg += wxT("\n");
+ }
+
+ msg.Append (wxT("\nODBC errors:\n"));
+ msg += wxT("\n");
+
+ // Display errors for this connection
+ int i;
+ for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
+ {
+ if (pDb->errorList[i])
+ {
+ msg.Append(pDb->errorList[i]);
+ if (wxStrcmp(pDb->errorList[i],wxT("")) != 0)
+ msg.Append(wxT("\n"));
+ // Clear the errmsg buffer so the next error will not
+ // end up showing the previous error that have occurred
+ wxStrcpy(pDb->errorList[i],wxT(""));
+ }
+ }
+ msg += wxT("\n");
+
+ wxLogDebug(msg.c_str());
+
+ return msg.c_str();
+} // wxDbLogExtendedErrorMsg()
+
+