ODBC updates (it almost works now)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
09d27bb444
commit
1acd7ba6f2
@ -263,12 +263,12 @@ public:
|
||||
struct
|
||||
{
|
||||
char dbmsName[40]; // Name of the dbms product
|
||||
char dbmsVer[20]; // Version # of the dbms product
|
||||
char dbmsVer[40]; // Version # of the dbms product
|
||||
char driverName[40]; // Driver name
|
||||
char odbcVer[20]; // ODBC version of the driver
|
||||
char drvMgrOdbcVer[20]; // ODBC version of the driver manager
|
||||
char driverVer[40]; // Driver version
|
||||
char serverName[40]; // Server Name, typically a connect string
|
||||
char odbcVer[60]; // ODBC version of the driver
|
||||
char drvMgrOdbcVer[60]; // ODBC version of the driver manager
|
||||
char driverVer[60]; // Driver version
|
||||
char serverName[80]; // Server Name, typically a connect string
|
||||
char databaseName[128]; // Database filename
|
||||
char outerJoins[2]; // Indicates whether the data source supports outer joins
|
||||
char procedureSupport[2]; // Indicates whether the data source supports stored procedures
|
||||
|
@ -319,7 +319,7 @@ bool wxDB::getDbInfo(void)
|
||||
if (SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR*) dbInf.dbmsName, 40, &cb) != SQL_SUCCESS)
|
||||
return(DispAllErrors(henv, hdbc));
|
||||
|
||||
if (SQLGetInfo(hdbc, SQL_DBMS_VER, (UCHAR*) dbInf.dbmsVer, 20, &cb) != SQL_SUCCESS)
|
||||
if (SQLGetInfo(hdbc, SQL_DBMS_VER, (UCHAR*) dbInf.dbmsVer, 40, &cb) != SQL_SUCCESS)
|
||||
return(DispAllErrors(henv, hdbc));
|
||||
|
||||
if (SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, (UCHAR*) &dbInf.maxConnections, sizeof(dbInf.maxConnections), &cb) != SQL_SUCCESS)
|
||||
@ -331,13 +331,13 @@ bool wxDB::getDbInfo(void)
|
||||
if (SQLGetInfo(hdbc, SQL_DRIVER_NAME, (UCHAR*) dbInf.driverName, 40, &cb) != SQL_SUCCESS)
|
||||
return(DispAllErrors(henv, hdbc));
|
||||
|
||||
if (SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 20, &cb) != SQL_SUCCESS)
|
||||
if (SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, 60, &cb) == SQL_ERROR)
|
||||
return(DispAllErrors(henv, hdbc));
|
||||
|
||||
if (SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 20, &cb) != SQL_SUCCESS)
|
||||
if (SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, 60, &cb) == SQL_ERROR)
|
||||
return(DispAllErrors(henv, hdbc));
|
||||
|
||||
if (SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 40, &cb) != SQL_SUCCESS)
|
||||
if (SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, 60, &cb) == SQL_ERROR)
|
||||
return(DispAllErrors(henv, hdbc));
|
||||
|
||||
if (SQLGetInfo(hdbc, SQL_ODBC_API_CONFORMANCE, (UCHAR*) &dbInf.apiConfLvl, sizeof(dbInf.apiConfLvl), &cb) != SQL_SUCCESS)
|
||||
|
@ -35,7 +35,8 @@ LIB_CPP_SRC=\
|
||||
common/memory.cpp \
|
||||
common/module.cpp \
|
||||
common/object.cpp \
|
||||
common/odbc.cpp \
|
||||
common/db.cpp \
|
||||
common/dbtable.cpp \
|
||||
common/postscrp.cpp \
|
||||
common/prntbase.cpp \
|
||||
common/serbase.cpp \
|
||||
|
@ -7,6 +7,12 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* never trace, Robert Roebling */
|
||||
|
||||
#ifndef NO_TRACE
|
||||
#define NO_TRACE
|
||||
#endif
|
||||
|
||||
# define TRACE_TYPE_APP2DM 1
|
||||
# define TRACE_TYPE_DM2DRV 2
|
||||
# define TRACE_TYPE_DRV2DM 3
|
||||
|
@ -122,7 +122,7 @@ getinitfile(char* buf, int size)
|
||||
int i, j;
|
||||
char* ptr;
|
||||
|
||||
j = STRLEN("/iodbc.ini") + 1;
|
||||
j = STRLEN("/odbc.ini") + 1;
|
||||
|
||||
if( size < j )
|
||||
{
|
||||
@ -130,13 +130,13 @@ getinitfile(char* buf, int size)
|
||||
}
|
||||
|
||||
#ifdef FIX_INI_FILE
|
||||
sprintf( buf, "%s/iodbc.ini", DIR_INI_FILE );
|
||||
sprintf( buf, "%s/odbc.ini", DIR_INI_FILE );
|
||||
#else
|
||||
# ifdef OS2
|
||||
*buf = '\0';
|
||||
if( NULL != getenv("IODBC_INI") )
|
||||
if( NULL != getenv("ODBC_INI") )
|
||||
{
|
||||
strcpy( buf, getenv("IODBC_INI") );
|
||||
strcpy( buf, getenv("ODBC_INI") );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -151,7 +151,7 @@ getinitfile(char* buf, int size)
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( buf, "iodbc.ini" );
|
||||
strcpy( buf, "odbc.ini" );
|
||||
}
|
||||
|
||||
}
|
||||
@ -166,7 +166,7 @@ getinitfile(char* buf, int size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf( buf + i, "/iodbc.ini");
|
||||
sprintf( buf + i, "/odbc.ini");
|
||||
|
||||
return buf;
|
||||
# else
|
||||
@ -189,8 +189,8 @@ getinitfile(char* buf, int size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf( buf, "%s%s", ptr, "/.iodbc.ini");
|
||||
/* i.e. searching ~/.iodbc.ini */
|
||||
sprintf( buf, "%s%s", ptr, "/.odbc.ini");
|
||||
/* i.e. searching ~/.odbc.ini */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user