Add support for Sybase 11
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
|
||||
// Use this line for wxWindows v1.x
|
||||
//#include "wx_ver.h"
|
||||
// Use this line for wxWindows v2.x
|
||||
@@ -2463,8 +2464,8 @@ wxDBMS wxDb::Dbms(void)
|
||||
*/
|
||||
{
|
||||
wxChar baseName[25+1];
|
||||
|
||||
wxStrncpy(baseName,dbInf.dbmsName,25);
|
||||
|
||||
if (!wxStricmp(dbInf.dbmsName,"Adaptive Server Anywhere"))
|
||||
return(dbmsSYBASE_ASA);
|
||||
if (!wxStricmp(dbInf.dbmsName,"SQL Server")) // Sybase Adaptive Server
|
||||
@@ -2480,6 +2481,7 @@ wxDBMS wxDb::Dbms(void)
|
||||
if (!wxStricmp(baseName,"Informix"))
|
||||
return(dbmsINFORMIX);
|
||||
|
||||
|
||||
baseName[6] = 0;
|
||||
if (!wxStricmp(baseName,"Oracle"))
|
||||
return(dbmsORACLE);
|
||||
@@ -2487,6 +2489,8 @@ wxDBMS wxDb::Dbms(void)
|
||||
return(dbmsACCESS);
|
||||
if (!wxStricmp(dbInf.dbmsName,"MySQL"))
|
||||
return(dbmsMY_SQL);
|
||||
if (!wxStricmp(baseName,"Sybase"))
|
||||
return(dbmsSYBASE_ASA);
|
||||
|
||||
baseName[5] = 0;
|
||||
if (!wxStricmp(baseName,"DBASE"))
|
||||
|
@@ -560,7 +560,6 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const char *
|
||||
|
||||
// Execute the SQL SELECT statement
|
||||
int retcode;
|
||||
|
||||
retcode = SQLExecDirect(hstmt, (UCHAR FAR *) (queryType == DB_SELECT_STATEMENT ? pSqlStmt : sqlStmt), SQL_NTS);
|
||||
if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO)
|
||||
return(pDb->DispAllErrors(henv, hdbc, hstmt));
|
||||
@@ -1082,6 +1081,7 @@ bool wxDbTable::DropTable()
|
||||
{
|
||||
// Check for product specific error codes
|
||||
if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,"42000")) || // 5.x (and lower?)
|
||||
(pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,"37000")) ||
|
||||
(pDb->Dbms() == dbmsMY_SQL && !wxStrcmp(pDb->sqlState,"S1000")) || // untested
|
||||
(pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,"08S01")))) // untested
|
||||
{
|
||||
|
Reference in New Issue
Block a user