- bool GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SDWORD FAR *cbReturned);
- bool Grant(int privileges, const char *tableName, const char *userList = "PUBLIC");
- int TranslateSqlState(const char *SQLState);
- wxDbInf *GetCatalog(char *userID);
- bool Catalog(const char *userID=NULL, const char *fileName = SQL_CATALOG_FILENAME);
- int GetKeyFields(char *tableName, wxColInf* colInf,int nocols);
- wxColInf *GetColumns(char *tableName[], const char *userID=NULL);
- wxColInf *GetColumns(char *tableName, int *numCols, const char *userID=NULL);
- int GetColumnCount(char *tableName, const char *userID=NULL);
- char *GetDatabaseName(void) {return dbInf.dbmsName;}
- char *GetDataSource(void) {return dsn;}
- char *GetUsername(void) {return uid;}
- char *GetPassword(void) {return authStr;}
- bool IsOpen(void) {return dbIsOpen;}
- HENV GetHENV(void) {return henv;}
- HDBC GetHDBC(void) {return hdbc;}
- HSTMT GetHSTMT(void) {return hstmt;}
- bool TableExists(const char *tableName, const char *userID=NULL, const char *path=NULL); // Table name can refer to a table, view, alias or synonym
- void LogError(const char *errMsg, const char *SQLState = 0) {logError(errMsg, SQLState);}
- bool SqlLog(enum sqlLog state, const char *filename = SQL_LOG_FILENAME, bool append = FALSE);
- bool WriteSqlLog(const char *logMsg);
- DBMS Dbms(void);
- bool FwdOnlyCursors(void) {return fwdOnlyCursors;}
-}; // wxDB
+ bool GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SQLLEN FAR *cbReturned);
+ bool Grant(int privileges, const wxString &tableName, const wxString &userList = wxT("PUBLIC"));
+ int TranslateSqlState(const wxString &SQLState);
+ wxDbInf *GetCatalog(const wxChar *userID=NULL);
+ bool Catalog(const wxChar *userID=NULL, const wxString &fileName=SQL_CATALOG_FILENAME);
+ int GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCols);
+
+ wxDbColInf *GetColumns(wxChar *tableName[], const wxChar *userID=NULL);
+ wxDbColInf *GetColumns(const wxString &tableName, UWORD *numCols, const wxChar *userID=NULL);
+
+ int GetColumnCount(const wxString &tableName, const wxChar *userID=NULL);
+ const wxChar *GetDatabaseName(void) {return dbInf.dbmsName;}
+ const wxString &GetDataSource(void) {return dsn;}
+ const wxString &GetDatasourceName(void){return dsn;}
+ const wxString &GetUsername(void) {return uid;}
+ const wxString &GetPassword(void) {return authStr;}
+ const wxString &GetConnectionInStr(void) {return inConnectionStr;}
+ const wxString &GetConnectionOutStr(void) {return outConnectionStr;}
+ bool IsOpen(void) {return dbIsOpen;}
+ bool OpenedWithConnectionString(void) {return dbOpenedWithConnectionString;}
+ HENV GetHENV(void) {return henv;}
+ HDBC GetHDBC(void) {return hdbc;}
+ HSTMT GetHSTMT(void) {return hstmt;}
+ int GetTableCount() {return nTables;} // number of tables using this connection
+ wxDbSqlTypeInfo GetTypeInfVarchar() {return typeInfVarchar;}
+ wxDbSqlTypeInfo GetTypeInfInteger() {return typeInfInteger;}
+ wxDbSqlTypeInfo GetTypeInfFloat() {return typeInfFloat;}
+ wxDbSqlTypeInfo GetTypeInfDate() {return typeInfDate;}
+ wxDbSqlTypeInfo GetTypeInfBlob() {return typeInfBlob;}
+
+ // tableName can refer to a table, view, alias or synonym
+ bool TableExists(const wxString &tableName, const wxChar *userID=NULL,
+ const wxString &tablePath=wxEmptyString);
+ bool TablePrivileges(const wxString &tableName, const wxString &priv,
+ const wxChar *userID=NULL, const wxChar *schema=NULL,
+ const wxString &path=wxEmptyString);
+
+ // These two functions return the table name or column name in a form ready
+ // for use in SQL statements. For example, if the datasource allows spaces
+ // in the table name or column name, the returned string will have the
+ // correct enclosing marks around the name to allow it to be properly
+ // included in a SQL statement
+ const wxString SQLTableName(const wxChar *tableName);
+ const wxString SQLColumnName(const wxChar *colName);
+
+ void LogError(const wxString &errMsg, const wxString &SQLState = wxEmptyString)
+ { logError(errMsg, SQLState); }
+ void SetDebugErrorMessages(bool state) { silent = !state; }
+ bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME,
+ bool append = false);
+ bool WriteSqlLog(const wxString &logMsg);
+
+ wxDBMS Dbms(void);
+ bool ModifyColumn(const wxString &tableName, const wxString &columnName,
+ int dataType, ULONG columnLength=0,
+ const wxString &optionalParam=wxEmptyString);
+
+ bool FwdOnlyCursors(void) {return fwdOnlyCursors;}
+
+ // These two functions are provided strictly for use by wxDbTable.
+ // DO NOT USE THESE FUNCTIONS, OR MEMORY LEAKS MAY OCCUR
+ void incrementTableCount() { nTables++; return; }
+ void decrementTableCount() { nTables--; return; }
+
+}; // wxDb
+