[DataWidget Index] [DataWidget Hierarchy]
Database specific part of the manager More...
#include <dbrecord.h>
Database specific part of the manager. The manager consists of two classes. DBDatasource keeps track of the state and emits the signals. A class derrived from DBRecord handles the database connection.
Constructor does nothing
Destructor does nothing
Is update, insert or delete possible ?
Returns a description of the last error
Defines the query string.
removeTables | Remove table definitions set by addTable() |
str | The query eg. "select * from table where id = ?" |
Defines a table, the primary keys and the columns. If you want to update the table, you have to define the primary keys.
table | The name of the database table. |
columns | The names of the columns seperated by blanks. It defaults to all columns if the string is 0 or "". |
primaries | Pairs of name=position sperated by blanks eg. "id=0 mid=1" |
Opens the database connection.
Closes the database connection.
Refreshes the dataset after a write operation. If you don't call refresh, the data is undefined.
Go to the first record.
invalid | Will become true if the record does not exist. |
Go to the previous record.
invalid | Will become true if the record does not exist. |
Go to the next record.
invalid | Will become true if the record does not exist. |
Go to the last record.
invalid | Will become true if the record does not exist. |
Go to the given record.
invalid | Will become true if the record does not exist. |
offset | Number of records to move. |
Go to the given record.
position | Index of the record, zero based. |
invalid | Will become true if the record does not exist. |
Returns the position of the record [zero based] or BOFCursor, EOFCursor, InsertCursor, InitCursor.
Cancels append and setValue, restores the old values.
Is an insert/update necessary
Updates the Database if the values had been changed.
done | Becomes true if the update was performd. |
force | Update even if no field had been changed. |
Insert into the Database if the values had been changed.
done | Becomes true if the insert was performd. |
force | Insert even if no field had been changed. |
Prepare working area for an insert.
todo |
SetCopy fetches the values from the current record. SetZero init to 0 or "". SetNull init null values SetAutoNull init autoincrement columns for generating a new value |
Deletes the current record from the database.
Saves the current state, the cursor and the curernt values of the fields.
Restores the state from the last backup.
Returns the number of columns;
Returns the name or alias of the column, zero based.
Returns the name or alias of the table, zero based.
Returns the type of the column, zero based.
Returns the type of the column, zero based.
Returns the size of the column, zero based.
Returns the precision of the column, zero based.
Returns the scale of the column, zero based.
Returns the display size of the column, zero based.
Is the column nullable, zero based.
Is the column unsigned, zero based.
Is the column a money value, zero based.
Is the column updateable, zero based.
Is it a auto increment column, zero based.
Returns the number of rows of query.
Changes the value in the working area.
field | The new value |
column | The index of the column, zero based. |
markDirty | An insert() or update() will do nothing if there was no markDirty call. |
Changes the parameter of the select statement.
field | The new value |
column | The index of the column, zero based. |
Returns the value from the working area. If the working area was not initialzed with append() and the value had not been set with setValue(), the value is fetched from the database.
If setParameter was called, the method returns the old value. Otherwise it creates a DBField with a proper type.
| Kdoc |