- 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 wxChar *SQLState);
- wxDbInf *GetCatalog(char *userID);
- bool Catalog(const char *userID=NULL, const char *fileName = SQL_CATALOG_FILENAME);
- int GetKeyFields(char *tableName, wxDbColInf* colInf, int nocols);
-
- wxDbColInf *GetColumns(char *tableName[], const char *userID=NULL);
- wxDbColInf *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;}
- 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;}
-
- 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 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;}
+ wxDbSqlTypeInfo GetTypeInfMemo() {return typeInfMemo;}
+
+ // 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); }