Standardized the parameter names for "colNo" in all places
A few more unicode adjustments (but Unicode is still not supported by these classes)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12610
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
//TODO: Need to Document
typedef enum { WX_ROW_MODE_QUERY , WX_ROW_MODE_INDIVIDUAL } rowmode_t;
virtual void SetRowMode(const rowmode_t rowmode);
//TODO: Need to Document
typedef enum { WX_ROW_MODE_QUERY , WX_ROW_MODE_INDIVIDUAL } rowmode_t;
virtual void SetRowMode(const rowmode_t rowmode);
- virtual wxVariant GetCol(const int Colno) const ;
- virtual void SetCol(const int ColNo, const wxVariant value);
+ virtual wxVariant GetCol(const int colNo) const ;
+ virtual void SetCol(const int colNo, const wxVariant value);
virtual GenericKey GetKey(void);
virtual void SetKey(const GenericKey &key);
virtual GenericKey GetKey(void);
virtual void SetKey(const GenericKey &key);
case dbmsINFORMIX:
case dbmsSYBASE_ASA:
case dbmsSYBASE_ASE:
case dbmsINFORMIX:
case dbmsSYBASE_ASA:
case dbmsSYBASE_ASE:
} // wxDbTable::SetRowMode()
} // wxDbTable::SetRowMode()
-wxVariant wxDbTable::GetCol(const int col) const
+wxVariant wxDbTable::GetCol(const int colNo) const
- if ((col < noCols) && (!IsColNull(col)))
+ if ((colNo < noCols) && (!IsColNull(colNo)))
- switch (colDefs[col].SqlCtype)
+ switch (colDefs[colNo].SqlCtype)
{
case SQL_CHAR:
case SQL_VARCHAR:
{
case SQL_CHAR:
case SQL_VARCHAR:
- val = (char *)(colDefs[col].PtrDataObj);
+ val = (wxChar *)(colDefs[colNo].PtrDataObj);
break;
case SQL_C_LONG:
case SQL_C_SLONG:
break;
case SQL_C_LONG:
case SQL_C_SLONG:
- val = *(long *)(colDefs[col].PtrDataObj);
+ val = *(long *)(colDefs[colNo].PtrDataObj);
break;
case SQL_C_SHORT:
case SQL_C_SSHORT:
break;
case SQL_C_SHORT:
case SQL_C_SSHORT:
- val = (long int )(*(short *)(colDefs[col].PtrDataObj));
+ val = (long int )(*(short *)(colDefs[colNo].PtrDataObj));
- val = (long)(*(unsigned long *)(colDefs[col].PtrDataObj));
+ val = (long)(*(unsigned long *)(colDefs[colNo].PtrDataObj));
break;
case SQL_C_TINYINT:
break;
case SQL_C_TINYINT:
- val = (long)(*(char *)(colDefs[col].PtrDataObj));
+ val = (long)(*(char *)(colDefs[colNo].PtrDataObj));
break;
case SQL_C_UTINYINT:
break;
case SQL_C_UTINYINT:
- val = (long)(*(unsigned char *)(colDefs[col].PtrDataObj));
+ val = (long)(*(unsigned char *)(colDefs[colNo].PtrDataObj));
break;
case SQL_C_USHORT:
break;
case SQL_C_USHORT:
- val = (long)(*(UWORD *)(colDefs[col].PtrDataObj));
+ val = (long)(*(UWORD *)(colDefs[colNo].PtrDataObj));
- val = (DATE_STRUCT *)(colDefs[col].PtrDataObj);
+ val = (DATE_STRUCT *)(colDefs[colNo].PtrDataObj);
- val = (TIME_STRUCT *)(colDefs[col].PtrDataObj);
+ val = (TIME_STRUCT *)(colDefs[colNo].PtrDataObj);
break;
case SQL_C_TIMESTAMP:
break;
case SQL_C_TIMESTAMP:
- val = (TIMESTAMP_STRUCT *)(colDefs[col].PtrDataObj);
+ val = (TIMESTAMP_STRUCT *)(colDefs[colNo].PtrDataObj);
break;
case SQL_C_DOUBLE:
break;
case SQL_C_DOUBLE:
- val = *(double *)(colDefs[col].PtrDataObj);
+ val = *(double *)(colDefs[colNo].PtrDataObj);
break;
default:
assert(0);
break;
default:
assert(0);
-void wxDbTable::SetCol(const int col, const wxVariant val)
+void wxDbTable::SetCol(const int colNo, const wxVariant val)
{
//FIXME: Add proper wxDateTime support to wxVariant..
wxDateTime dateval;
{
//FIXME: Add proper wxDateTime support to wxVariant..
wxDateTime dateval;
- SetColNull(col, val.IsNull());
+ SetColNull(colNo, val.IsNull());
- if ((colDefs[col].SqlCtype == SQL_C_DATE)
- || (colDefs[col].SqlCtype == SQL_C_TIME)
- || (colDefs[col].SqlCtype == SQL_C_TIMESTAMP))
+ if ((colDefs[colNo].SqlCtype == SQL_C_DATE)
+ || (colDefs[colNo].SqlCtype == SQL_C_TIME)
+ || (colDefs[colNo].SqlCtype == SQL_C_TIMESTAMP))
{
//Returns null if invalid!
if (!dateval.ParseDate(val.GetString()))
{
//Returns null if invalid!
if (!dateval.ParseDate(val.GetString()))
+ SetColNull(colNo, TRUE);
- switch (colDefs[col].SqlCtype)
+ switch (colDefs[colNo].SqlCtype)
{
case SQL_CHAR:
case SQL_VARCHAR:
{
case SQL_CHAR:
case SQL_VARCHAR:
- csstrncpyt((char *)(colDefs[col].PtrDataObj),
+ csstrncpyt((char *)(colDefs[colNo].PtrDataObj),
- colDefs[col].SzDataObj-1);
+ colDefs[colNo].SzDataObj-1);
break;
case SQL_C_LONG:
case SQL_C_SLONG:
break;
case SQL_C_LONG:
case SQL_C_SLONG:
- *(long *)(colDefs[col].PtrDataObj) = val;
+ *(long *)(colDefs[colNo].PtrDataObj) = val;
break;
case SQL_C_SHORT:
case SQL_C_SSHORT:
break;
case SQL_C_SHORT:
case SQL_C_SSHORT:
- *(short *)(colDefs[col].PtrDataObj) = val.GetLong();
+ *(short *)(colDefs[colNo].PtrDataObj) = val.GetLong();
- *(unsigned long *)(colDefs[col].PtrDataObj) = val.GetLong();
+ *(unsigned long *)(colDefs[colNo].PtrDataObj) = val.GetLong();
break;
case SQL_C_TINYINT:
break;
case SQL_C_TINYINT:
- *(char *)(colDefs[col].PtrDataObj) = val.GetChar();
+ *(char *)(colDefs[colNo].PtrDataObj) = val.GetChar();
break;
case SQL_C_UTINYINT:
break;
case SQL_C_UTINYINT:
- *(unsigned char *)(colDefs[col].PtrDataObj) = val.GetChar();
+ *(unsigned char *)(colDefs[colNo].PtrDataObj) = val.GetChar();
break;
case SQL_C_USHORT:
break;
case SQL_C_USHORT:
- *(unsigned short *)(colDefs[col].PtrDataObj) = val.GetLong();
+ *(unsigned short *)(colDefs[colNo].PtrDataObj) = val.GetLong();
break;
//FIXME: Add proper wxDateTime support to wxVariant..
case SQL_C_DATE:
{
DATE_STRUCT *dataptr =
break;
//FIXME: Add proper wxDateTime support to wxVariant..
case SQL_C_DATE:
{
DATE_STRUCT *dataptr =
- (DATE_STRUCT *)colDefs[col].PtrDataObj;
+ (DATE_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->year = dateval.GetYear();
dataptr->month = dateval.GetMonth()+1;
dataptr->year = dateval.GetYear();
dataptr->month = dateval.GetMonth()+1;
case SQL_C_TIME:
{
TIME_STRUCT *dataptr =
case SQL_C_TIME:
{
TIME_STRUCT *dataptr =
- (TIME_STRUCT *)colDefs[col].PtrDataObj;
+ (TIME_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->hour = dateval.GetHour();
dataptr->minute = dateval.GetMinute();
dataptr->hour = dateval.GetHour();
dataptr->minute = dateval.GetMinute();
case SQL_C_TIMESTAMP:
{
TIMESTAMP_STRUCT *dataptr =
case SQL_C_TIMESTAMP:
{
TIMESTAMP_STRUCT *dataptr =
- (TIMESTAMP_STRUCT *)colDefs[col].PtrDataObj;
+ (TIMESTAMP_STRUCT *)colDefs[colNo].PtrDataObj;
dataptr->year = dateval.GetYear();
dataptr->month = dateval.GetMonth()+1;
dataptr->day = dateval.GetDay();
dataptr->year = dateval.GetYear();
dataptr->month = dateval.GetMonth()+1;
dataptr->day = dateval.GetDay();
}
break;
case SQL_C_DOUBLE:
}
break;
case SQL_C_DOUBLE:
- *(double *)(colDefs[col].PtrDataObj) = val;
+ *(double *)(colDefs[colNo].PtrDataObj) = val;
break;
default:
assert(0);
break;
default:
assert(0);
GenericKey wxDbTable::GetKey()
{
void *blk;
GenericKey wxDbTable::GetKey()
{
void *blk;
+ blkptr = (wxChar *) blk;
int i;
for (i=0; i < noCols; i++)
int i;
for (i=0; i < noCols; i++)
void wxDbTable::SetKey(const GenericKey& k)
{
void wxDbTable::SetKey(const GenericKey& k)
{
- void *blk;
- char *blkptr;
+ void *blk;
+ wxChar *blkptr;
+ blkptr = (wxChar *)blk;
int i;
for (i=0; i < noCols; i++)
int i;
for (i=0; i < noCols; i++)