git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38385
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
+// Name: src/common/dbtable.cpp
// Purpose: Implementation of the wxDbTable class.
// Author: Doug Card
// Modified by: George Tasker
// Purpose: Implementation of the wxDbTable class.
// Author: Doug Card
// Modified by: George Tasker
#ifdef DBDEBUG_CONSOLE
#if wxUSE_IOSTREAMH
#include <iostream.h>
#ifdef DBDEBUG_CONSOLE
#if wxUSE_IOSTREAMH
#include <iostream.h>
#endif
#include "wx/filefn.h"
#endif
#include "wx/filefn.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
tableName.Empty();
queryTableName.Empty();
tableName.Empty();
queryTableName.Empty();
- wxASSERT(tblName.Length());
+ wxASSERT(tblName.length());
(pDb->Dbms() == dbmsINTERBASE))
tableName = tableName.Upper();
(pDb->Dbms() == dbmsINTERBASE))
tableName = tableName.Upper();
tablePath = tblPath; // Table Path - used for dBase files
else
tablePath.Empty();
tablePath = tblPath; // Table Path - used for dBase files
else
tablePath.Empty();
- if (qryTblName.Length()) // Name of the table/view to query
+ if (qryTblName.length()) // Name of the table/view to query
queryTableName = qryTblName;
else
queryTableName = tblName;
queryTableName = qryTblName;
else
queryTableName = tblName;
else
colDefs[columnIndex].CbValue = SQL_NTS;
break;
else
colDefs[columnIndex].CbValue = SQL_NTS;
break;
case DB_DATA_TYPE_INTEGER:
if (colDefs[columnIndex].Null)
colDefs[columnIndex].CbValue = SQL_NULL_DATA;
case DB_DATA_TYPE_INTEGER:
if (colDefs[columnIndex].Null)
colDefs[columnIndex].CbValue = SQL_NULL_DATA;
// Handle the case of DeleteWhere() and the where clause is blank. It should
// delete all records from the database in this case.
// Handle the case of DeleteWhere() and the where clause is blank. It should
// delete all records from the database in this case.
- if (typeOfDel == DB_DEL_WHERE && (pWhereClause.Length() == 0))
+ if (typeOfDel == DB_DEL_WHERE && (pWhereClause.length() == 0))
{
pSqlStmt.Printf(wxT("DELETE FROM %s"),
pDb->SQLTableName(tableName.c_str()).c_str());
{
pSqlStmt.Printf(wxT("DELETE FROM %s"),
pDb->SQLTableName(tableName.c_str()).c_str());
if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from))
appendFromClause = true;
#else
if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from))
appendFromClause = true;
#else
- if (typeOfSelect == DB_SELECT_WHERE && from.Length())
+ if (typeOfSelect == DB_SELECT_WHERE && from.length())
appendFromClause = true;
#endif
appendFromClause = true;
#endif
#if wxODBC_BACKWARD_COMPATABILITY
if (where && wxStrlen(where)) // May not want a where clause!!!
#else
#if wxODBC_BACKWARD_COMPATABILITY
if (where && wxStrlen(where)) // May not want a where clause!!!
#else
- if (where.Length()) // May not want a where clause!!!
+ if (where.length()) // May not want a where clause!!!
#endif
{
pSqlStmt += wxT(" WHERE ");
#endif
{
pSqlStmt += wxT(" WHERE ");
break;
case DB_SELECT_KEYFIELDS:
BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
break;
case DB_SELECT_KEYFIELDS:
BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS);
- if (whereClause.Length())
+ if (whereClause.length())
{
pSqlStmt += wxT(" WHERE ");
pSqlStmt += whereClause;
{
pSqlStmt += wxT(" WHERE ");
pSqlStmt += whereClause;
break;
case DB_SELECT_MATCHING:
BuildWhereClause(whereClause, DB_WHERE_MATCHING);
break;
case DB_SELECT_MATCHING:
BuildWhereClause(whereClause, DB_WHERE_MATCHING);
- if (whereClause.Length())
+ if (whereClause.length())
{
pSqlStmt += wxT(" WHERE ");
pSqlStmt += whereClause;
{
pSqlStmt += wxT(" WHERE ");
pSqlStmt += whereClause;
#if wxODBC_BACKWARD_COMPATABILITY
if (orderBy && wxStrlen(orderBy))
#else
#if wxODBC_BACKWARD_COMPATABILITY
if (orderBy && wxStrlen(orderBy))
#else
#endif
{
pSqlStmt += wxT(" ORDER BY ");
#endif
{
pSqlStmt += wxT(" ORDER BY ");
// Concatenate where phrase for the column
wxString tStr = colDefs[colNumber].ColName;
// Concatenate where phrase for the column
wxString tStr = colDefs[colNumber].ColName;
- if (qualTableName.Length() && tStr.Find(wxT('.')) == wxNOT_FOUND)
+ if (qualTableName.length() && tStr.Find(wxT('.')) == wxNOT_FOUND)
{
pWhereClause += pDb->SQLTableName(qualTableName);
pWhereClause += wxT(".");
{
pWhereClause += pDb->SQLTableName(qualTableName);
pWhereClause += wxT(".");
if (!colDefs) // May happen if the database connection fails
return false;
if (!colDefs) // May happen if the database connection fails
return false;
- if (fieldName.Length() > (unsigned int) DB_MAX_COLUMN_NAME_LEN)
+ if (fieldName.length() > (unsigned int) DB_MAX_COLUMN_NAME_LEN)
{
wxStrncpy(colDefs[index].ColName, fieldName, DB_MAX_COLUMN_NAME_LEN);
colDefs[index].ColName[DB_MAX_COLUMN_NAME_LEN] = 0; // Prevent buffer overrun
{
wxStrncpy(colDefs[index].ColName, fieldName, DB_MAX_COLUMN_NAME_LEN);
colDefs[index].ColName[DB_MAX_COLUMN_NAME_LEN] = 0; // Prevent buffer overrun
#if wxODBC_BACKWARD_COMPATABILITY
if (from && wxStrlen(from))
#else
#if wxODBC_BACKWARD_COMPATABILITY
if (from && wxStrlen(from))
#else
#if wxODBC_BACKWARD_COMPATABILITY
if (where && wxStrlen(where))
#else
#if wxODBC_BACKWARD_COMPATABILITY
if (where && wxStrlen(where))
#else
#endif
{
sqlStmt += wxT(" WHERE ");
#endif
{
sqlStmt += wxT(" WHERE ");