# class hk_datasource

represents a resultquery or a table of a database. More...

Definition | `#include <hk_classes/hk_classes/hk_datasource.h>`
Inherits | hk_data [public ]
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum enum_tablemodes {mode_normal,mode_createtable,mode_altertable,mode_disabled,mode_insertrow,mode_deleterow,mode_unknown}
- enum enum_accessmode {standard,batchread,batchwrite}
- typedef class --
- enum enum_dependingmodes {depending_nohandle,depending_standard,depending_change,depending_delete,depending_changedelete}

#### Public Methods

- virtual ~hk_datasource ()
- virtual void set_name (const hk_string& n,bool registerchange=true)
- virtual hk_string name (void)
- enum_tablemodes mode (void)
- void setmode_insertrow (void)
- void delete_actualrow (void)
- void setmode_normal (void)
- void setmode_createtable (void)
- void setmode_altertable (void)
- hk_column* new_column (void)
- bool alter_column (const hk_string& col, const hk_string* name=NULL,hk_column::enum_columntype* newtype=NULL,long* size=NULL,const hk_string* defaultvalue=NULL,const bool* primary=NULL,const bool* notnull=NULL)
- bool delete_column (const hk_string& col)
- bool create_table_now (void)
- bool alter_table_now (void)
- virtual bool goto_row (unsigned long r)
- bool goto_first (void)
- bool goto_last (void)
- bool goto_next (void)
- bool goto_previous (void)
- bool goto_random (void)
- unsigned long row_position (void)
- unsigned long max_rows (void)
- bool set_accessmode (enum_accessmode)
- enum_accessmode accessmode (void) const
- bool enable (void)
- bool disable (void)
- bool set_enabled (bool e)
- bool is_enabled (void)
- bool is_readonly (void)
- void set_readonly (bool r)
- list<hk_column*>* columns (void)
- hk_column* column_by_name (const hk_string& c)
- hk_column* column_by_name (const hk_string& c, int colnumber)
- int columnname_occurances (const hk_string& colname)
- int columnname_occurance (hk_column*)
- bool set_sql (const hk_string& s,bool rawsql=false,bool registerchange=true)
- hk_string sql (void)
- bool is_rawsql (void)
- list<indexclass>* indices (void)
- bool drop_index (const hk_string& i)
- bool create_index (const hk_string& name,bool unique, list<hk_string>& fields)
- bool alter_index (const hk_string& name,bool unique,list<hk_string>& fields)
- enum_dependingmodes dependingmode (void)
- bool set_depending_on (hk_datasource* d,bool react_on_data_changes=false,enum_dependingmodes mode=depending_standard)
- hk_datasource* depending_on (void)
- bool depending_on_react_on_data_changes (void)
- list<hk_string>* depending_on_thisfields (void)
- list<hk_string>* depending_on_masterfields (void)
- bool set_depending_on_presentationdatasource (long d,bool react_on_data_changes=false,enum_dependingmodes mode=depending_standard,bool registerchange=true)
- long depending_on_presentationdatasource (void)
- void add_depending_fields (const hk_string& this_ds_field, const hk_string& master_ds_field,bool registerchange=true)
- void clear_depending_fields (void)
- bool store_changed_data (enum_interaction c=interactive)
- void set_ignore_changed_data (void)
- bool ignore_changed_data (void) const
- void set_filter (const hk_string& f,bool registerchange=true)
- hk_string filter (void)
- void set_temporaryfilter (const hk_string&f)
- hk_string temporaryfilter (void)
- void set_use_temporaryfilter (bool use)
- bool use_temporaryfilter (void)
- void clear_filter (bool registerchange=true)
- void set_sorting (const hk_string& s,bool registerchange=true)
- hk_string sorting (void)
- void set_temporarysorting (const hk_string& s)
- hk_string temporarysorting (void)
- void set_use_temporarysorting (bool use)
- bool use_temporarysorting (void)
- void clear_sorting (bool registerchange=true)
- void set_automatic_data_update (bool u)
- bool is_automatic_data_update (void)
- void set_sqldelimiter (const hk_string&)
- void set_datetimeformat (const hk_string& datetime,const hk_string& date,const hk_string& time)
- hk_database* database (void)
- void savedata (ostream& s,bool saveall=true)
- void loaddata (const hk_string& definition,bool loadsql=true)
- long presentationnumber (void) const
- bool datasource_used (void) const
- virtual void dump_data ()
- bool ask_name (void)
- bool delete_rows (unsigned long from,unsigned long to,bool check_depending_datasources=true,bool ask=true)
- void transaction_begin (hk_string name="")
- void transaction_commit (hk_string name="")
- void transaction_rollback (hk_string name="")
- void set_blockvisiblesignals (bool v)
- bool blockvisiblesignals (void)
- void set_blockserversignals (bool)
- bool blockserversignals (void)
- void set_blockdatasourcesignals (bool)
- bool blockdatasourcesignals (void)
- void save_datasourcedefinition (ostream& s)
- bool load_datasourcedefinition (const hk_string& definition,bool use_xmltablename=true ,bool ask=true)
- hk_presentation* presentation (void)
- void set_position (int x,int y, bool registerchange=true)
- void set_size (int width,int height, bool registerchange=true)
- int x (void) const
- int y (void) const
- int width (void) const
- int height (void) const

#### Protected Types

- typedef class --
- typedef class --

#### Protected Methods

- hk_datasource (hk_database* db,hk_presentation* p=NULL)
- void column_remove (hk_column* col)
- void visible_add (hk_dsvisible* v)
- void visible_remove (hk_dsvisible* v)
- virtual void driver_specific_transaction_begin (hk_string)
- virtual void driver_specific_transaction_commit (hk_string)
- virtual void driver_specific_transaction_rollback (hk_string)
- virtual unsigned long driver_specific_max_rows (void)
- virtual bool driver_specific_set_accessmode (enum_accessmode)
- virtual bool driver_specific_batch_enable (void)
- virtual bool driver_specific_batch_disable (void)
- virtual bool driver_specific_batch_goto_next (void)
- virtual bool driver_specific_batch_goto_previous (void)
- virtual bool driver_specific_enable (void)
- virtual bool driver_specific_disable (void)
- virtual list<hk_column*>* driver_specific_columns (void)
- virtual bool driver_specific_goto_row (unsigned long r)
- virtual hk_column* driver_specific_new_column (void)
- virtual bool driver_specific_update_data (void)
- virtual bool driver_specific_delete_data_at (unsigned long)
- virtual bool driver_specific_insert_data (void)
- virtual bool driver_specific_create_table_now (void)
- virtual bool driver_specific_alter_table_now (void)
- virtual void driver_specific_before_drop_table (void)
- virtual void filelist_changes (filetype t)
- virtual list<indexclass>* driver_specific_indices (void)
- virtual bool driver_specific_drop_index (const hk_string& i)
- virtual bool driver_specific_create_index (const hk_string& name,bool unique,list<hk_string>& fields)
- virtual void before_connection_disconnects (void)
- virtual void before_source_vanishes (void)
- void depending_ds_add (hk_datasource* d)
- void depending_ds_remove (hk_datasource* d)
- void depending_on_datasource_row_change (bool take_changed_data=false)
- void depending_on_datasource_data_has_changed (void)
- void depending_on_datasource_after_store_changed_data (void)
- void depending_on_datasource_insertmode (void)
- bool depending_on_datasource_deleterow_ok (void)
- bool depending_on_datasource_before_delete_row (void)
- bool depending_on_datasource_updaterow_ok (void)
- void depending_on_datasource_before_update_row (void)
- void depending_on_datasource_after_update_row (void)
- void reload_data (bool take_changed_data=false)
- void create_actual_row_where_statement (void)
- hk_string create_row_where_statement_at (unsigned long int position,bool withwhere=true)
- void create_new_sql_statement (bool take_changed_data=false)
- hk_string whole_datasource_where_statement (bool take_changed_data=false)
- void print_sql (void)
- void clear_columnlist (void)
- void clear_modecolumnlists (void)
- void clear_visiblelist (void)
- void parse_sql (void)
- virtual bool update_row (enum_interaction c=interactive)
- virtual bool insert_row (enum_interaction c=interactive)
- virtual bool delete_row (enum_interaction c=interactive)
- void set_has_changed (void)
- void set_has_not_changed (void)

#### Protected Members

- bool p_casesensitive
- bool p_enabled
- bool p_readonly
- bool p_primary_key_used
- bool p_ignore_changed_data
- unsigned long p_counter
- hk_database* p_database
- list<hk_column*>* p_columns
- list<class_altercolumns> p_altercolumns
- list<hk_string> p_deletecolumns
- list<hk_column*> p_newcolumns
- list<hk_string> depending_this_fields
- list<hk_string> depending_master_fields
- struct_parsed_sql* p_parsed_sql
- hk_string p_sql
- hk_string p_actual_row_where
- bool p_automatic_data_update
- hk_actionquery* p_actionquery
- hk_string p_datetimeformat
- hk_string p_dateformat
- hk_string p_timeformat
- hk_string p_sql_delimiter
- hk_string p_true
- hk_string p_false
- bool p_tablesql_set

## Detailed Description

hk_datasource is the basic class which represents a resultquery or a table of a database. Never create this table directly. Use the hk_database::new_table method instead.

Two types of this class can be distinguished. Tables and Resultqueries.

Resultqueries are Queries with a SELECT - SQL-statement. The resulting data cannot be edited or manipulated.

Tables are a special form of resultqueries. The SQL-statement is fixed ("SELECT * FROM <tablename>), but the resulting dataset can be edited.

~hk_datasource ()

### ~hk_datasource

[virtual]

void set_name (const hk_string& n,bool registerchange=true)

### set_name

[virtual]

sets the name of the datasource

Parameters:

n | the name
registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed.

Reimplemented from hk_data.

hk_string name (void)

### name

[virtual]

Reimplemented from hk_data.

enum enum_tablemodes {mode_normal,mode_createtable,mode_altertable,mode_disabled,mode_insertrow,mode_deleterow,mode_unknown}

### enum_tablemodes

enum_tablemodes mode (void)

### mode

if this datasource is a table, it can be in different "modes". For example if you want to create a new table and define the different columns, the table has to be in "mode_create" See enum_tablemodes for the different modetypes.

void setmode_insertrow (void)

### setmode_insertrow

brings the datasource in insertmode. To add a new row call this function, set the data of the new row as usual in the columns (i.e.with hk_column::ashk_string ) and finally call either setmode_normal or store_changed_data.

void delete_actualrow (void)

### delete_actualrow

this function tries to delete the actual row. If there is a depending datasource with equivalent rows the actual row will not be deleted.

void setmode_normal (void)

### setmode_normal

This is the usual mode, where you can browse the data and if the data is not readonly change the data.

void setmode_createtable (void)

### setmode_createtable

If you want to create a new table first bring the table in createmode. Define new columns with new_column. Afterwards you can create the table by calling create_table_now

void setmode_altertable (void)

### setmode_altertable

If you want to alter an existing table first bring the table in altermode. Define new columns with new_column. Alter it with alter_column and delete a column by calling alter_column. Afterwards you can alter the table by calling alter_table_now

hk_column* new_column (void)

### new_column

if this datasource is of type "table" and in mode "create" or "alter" you can create a new column to define its parameters.

bool alter_column (const hk_string& col, const hk_string* name=NULL,hk_column::enum_columntype* newtype=NULL,long* size=NULL,const hk_string* defaultvalue=NULL,const bool* primary=NULL,const bool* notnull=NULL)

### alter_column

if this datasource is of type "table" and in mode "alter" you can alter an existing column. NULL values mean, that this part will not be changed

bool delete_column (const hk_string& col)

### delete_column

if this datasource is of type "table" and in mode "alter" you can delete an existing column.Just enter the name here.

bool create_table_now (void)

### create_table_now

After defining a new table with setmode_createtable and new_column this function creates physically the table

bool alter_table_now (void)

### alter_table_now

After altering an existing table with setmode_altertable, new_column ,alter_column and delete_column this function alters physically the table

bool goto_row (unsigned long r)

### goto_row

[virtual]

Goto a specific row. The first row number is 0, the last n-1 where n is the number of rows as delivered from max_rows().All depending objects will be informed (visible objects, depending datasources etc)

Parameters:

r | is the wished new row number to go.

Returns: true if success, else false.

bool goto_first (void)

### goto_first

move the row selector to the first row. All depending objects will be informed (visible objects, depending datasources etc)

Returns: true if success, else false.

bool goto_last (void)

### goto_last

move the row selector to the last row. All depending objects will be informed (visible objects, depending datasources etc)

Returns: true if success, else false.

bool goto_next (void)

### goto_next

move the row selector to the next row. All depending objects will be informed (visible objects, depending datasources etc)

Returns: true if success, else false.

bool goto_previous (void)

### goto_previous

move the row selector to the previous row. All depending objects will be informed (visible objects, depending datasources etc)

Returns: true if success, else false.

bool goto_random (void)

### goto_random

moves the rowselector to a random row.

unsigned long row_position (void)

### row_position

number of the current row.

unsigned long max_rows (void)

### max_rows

number of rows in this query.

enum enum_accessmode {standard,batchread,batchwrite}

### enum_accessmode

the accessmode regulates the behaviour of the datasource. In mode 'standard' the datasource is readable and writeable, but usually first loads all the data from the SQL server. This is in some cases not necessary. If you just need to serially read one row after another, you can use the 'batchread' mode. In this case random access is not possible and it is not possible to edit the data or insert rows (e.g. this is used in hk_report). In 'batchwrite' mode data can't be read and is only used for inserting data (e.g. used hk_importcsv) The batchmodes do not need as much memory as the standard mode.

bool set_accessmode (enum_accessmode)

### set_accessmode

enum_accessmode accessmode (void)

### accessmode

[const]

bool enable (void)

### enable

if hk_connection is connected, this method will enable the datasource. The SQL-Statement in SQL will be executed. If the SQL-statement is ok, the resulting data can be reached via the columns in columns. You can browse the data by using the methods goto_row, goto_first, goto_last, goto_next and goto_previous.

Returns: true if enable was successful.

bool disable (void)

### disable

if the datasource is enabled, this function will disable it. The columnlist will be deleted.

bool set_enabled (bool e)

### set_enabled

convenience function: if e is true the datasource will be enabled by calling enable else it will disable the datasource by calling disable.

bool is_enabled (void)

### is_enabled

shows whether the datasource is enabled.

bool is_readonly (void)

### is_readonly

Returns: true if data in this datasource can be changed. Always false if this datasource is a dml_query.

void set_readonly (bool r)

### set_readonly

If the datasource is of type ds_table you can allow or disallow data changes.

list<hk_column*>* columns (void)

### columns

if the datasource is enabled you get a list of all columns. The fields can be reached by columns. See hk_column for details.

hk_column* column_by_name (const hk_string& c)

### column_by_name

if the datasource is enabled, you can reach a particular column by name

Returns: hk_column if there is a column with this name else NULL.

hk_column* column_by_name (const hk_string& c, int colnumber)

### column_by_name

if the datasource is enabled, you can reach a particular column by name.

Parameters:

colnumber | If there are more than 1 columns with the same name this parameter tells which one to take (1 is the first column)

Returns: hk_column if there is a column with this name else NULL.

int columnname_occurances (const hk_string& colname)

### columnname_occurances

returns how many columns exist in this datasource with the name 'colname'. Usually columnnames should be unique, but it is unfortunately technically possible to create SQL statements that return ambigous columnnames

int columnname_occurance (hk_column*)

### columnname_occurance

returns if this is the first, second ... nth column with this name

bool set_sql (const hk_string& s,bool rawsql=false,bool registerchange=true)

### set_sql

set your own SQL statement, that will be executed when you enable the datasource. if this datasource is of type "table" it will be automatically created.

Parameters:

s | is the sql statement
rawsql | if true the sql statement will used as is (otherwise it may be changed to fit
registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed. sorting, filtering or depending on statements). So it is possible to execute driver specific result queries which do not contain the "SELECT" statement, i.e. SHOW FIELDS in Mysql.

hk_string sql (void)

### sql

bool is_rawsql (void)

### is_rawsql

typedef class --

### --

list<indexclass>* indices (void)

### indices

returns the list of all existing indices of a table or NULL in case of an error (i.e. not a table)

bool drop_index (const hk_string& i)

### drop_index

deletes an index of a table. returns true if successful otherwise false;

Parameters:

i | name of the index

bool create_index (const hk_string& name,bool unique, list<hk_string>& fields)

### create_index

creates an index of a table. returns true if successful otherwise false; make sure you have set the tablename first.

Parameters:

name | new name of the index
unique | true if this should be a unique index
fields | the field(column) names used by this index

Returns: true if successful otherwise false;

bool alter_index (const hk_string& name,bool unique,list<hk_string>& fields)

### alter_index

Alters an existing index by first dropping it with drop_index and then by trying to recreate it with create_index

enum enum_dependingmodes {depending_nohandle,depending_standard,depending_change,depending_delete,depending_changedelete}

### enum_dependingmodes

See dependingmode for details

enum_dependingmodes dependingmode (void)

### dependingmode

       depending_nohandle     = ignore that this is a depending datasource
       depending_standard     = can't delete a master row when there are
                                depending rows in the depending datasource
                                and can't change the value of a master connection field.
       depending_change       = if a master connection field is changed, the
                                equivalent depending fields will change their values too.
       depending_delete       = if the master row is deleted the depending rows will also be deleted
       depending_changedelete = combination of depending_change and depending_delete

See also set_depending_on for details

bool set_depending_on (hk_datasource* d,bool react_on_data_changes=false,enum_dependingmodes mode=depending_standard)

### set_depending_on

if there are 2 datasources in a 1:n relation it is possible to connect the 2 datasources. Add the master datasource here ( it's the '1'-datasource in the '1:n'-relation). Except of the master datasource you also have to add the connected fields with add_depending_fields This (the depending) datasource will enable/disable automatically when the master datasource will enable/disable. if this datasource is part of a hk_presentation use set_depending_on_presentationdatasource instead

Parameters:

d | is the master datasource
react_on_data_changes | true if the datasource should react when a value of the masterdatasource is changed but not yet stored
mode | how to react when the masterdatasource changes its data. See enum_dependingmodes for details.

hk_datasource* depending_on (void)

### depending_on

bool depending_on_react_on_data_changes (void)

### depending_on_react_on_data_changes

See dependingmode for details

list<hk_string>* depending_on_thisfields (void)

### depending_on_thisfields

a list of the depending on columns of this datasource set with add_depending_fields

list<hk_string>* depending_on_masterfields (void)

### depending_on_masterfields

a list of the depending on columns of the master datasource set with add_depending_fields

bool set_depending_on_presentationdatasource (long d,bool react_on_data_changes=false,enum_dependingmodes mode=depending_standard,bool registerchange=true)

### set_depending_on_presentationdatasource

if this datasource is part of a hk_presentation object (form or report) then set the depending on datasource with this function. You can get the unique datasource number of a datasource with presentationnumber

Parameters:

d | the presentationnumber of the master datasource
registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed.

long depending_on_presentationdatasource (void)

### depending_on_presentationdatasource

void add_depending_fields (const hk_string& this_ds_field, const hk_string& master_ds_field,bool registerchange=true)

### add_depending_fields

use this method in connection with depending_on.

Parameters:

this_ds_field | fieldname of a column of this datasource which has to be connected to the master datasource.
master_ds_field | columnname of the masterdatasource which value has to be equal with the value of this_ds_field.
registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed.

void clear_depending_fields (void)

### clear_depending_fields

clears the depending list.

bool store_changed_data (enum_interaction c=interactive)

### store_changed_data

if the data of the actual row has changed you can manually send the changes to the SQL Server by calling this function. The function will be called automatically before the datasource disables or the row selector will be moved to another row.

void set_ignore_changed_data (void)

### set_ignore_changed_data

bool ignore_changed_data (void)

### ignore_changed_data

[const]

void set_filter (const hk_string& f,bool registerchange=true)

### set_filter

it is possible to filter only specific rows from a datasource by setting this filter. just add the conditions with this function.

Parameters:

f | same syntax as a SQL statement in the 'WHERE' section, but without the word 'WHERE'
registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed. Example: SELECT * from addresses WHERE city="München", so you would call set_filter("city=\"München\"");

hk_string filter (void)

### filter

void set_temporaryfilter (const hk_string&f)

### set_temporaryfilter

temporary filters just work like filters (see set_filter ), but have to be manually activated with set_use_temporaryfilter. When loaded with loaddata temporaryfilters are deactivated by default.

hk_string temporaryfilter (void)

### temporaryfilter

void set_use_temporaryfilter (bool use)

### set_use_temporaryfilter

bool use_temporaryfilter (void)

### use_temporaryfilter

void clear_filter (bool registerchange=true)

### clear_filter

clears the filter which was set with set_filter

Parameters:

registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed.

void set_sorting (const hk_string& s,bool registerchange=true)

### set_sorting

it is possible to sort the datasource. just add the conditions with this function.

Parameters:

f | same syntax as a SQL statement in the "ORDER BY" section, but without the word "ORDER BY"
registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed. Example: SELECT * from addresses ORDER BY city DESC , so you would call set_sorting("city DESC");

hk_string sorting (void)

### sorting

void set_temporarysorting (const hk_string& s)

### set_temporarysorting

hk_string temporarysorting (void)

### temporarysorting

void set_use_temporarysorting (bool use)

### set_use_temporarysorting

bool use_temporarysorting (void)

### use_temporarysorting

void clear_sorting (bool registerchange=true)

### clear_sorting

clears the sorting instruction

Parameters:

registerchange | if this class is part of a hk_presentation object (i.e. a form or a report) and registerchange is true, then the changes will be stored when the hk_presentation object is closed.

void set_automatic_data_update (bool u)

### set_automatic_data_update

when data has changed and the row selector is moved to another row, usually the datasource will be automatically updated. If the value is set to false, you have to update the data manually by calling store_changed_data.

Parameters:

u | If you don't want the automatic update of data changes, set this paramter to false. The default value is true.

bool is_automatic_data_update (void)

### is_automatic_data_update

void set_sqldelimiter (const hk_string&)

### set_sqldelimiter

void set_datetimeformat (const hk_string& datetime,const hk_string& date,const hk_string& time)

### set_datetimeformat

sets the default date and timeformats for new created columns

hk_database* database (void)

### database

void savedata (ostream& s,bool saveall=true)

### savedata

stores the object's values to stream s. The following tags will be used

<TYPE> either QUERY or TABLE

<DATASOURCENAME> the name set with set_name

<SQL> the used sql statement

Additionally the section <DATASOURCEEXTRA> has the following tags

<FILTER> the filter set with set_filter

<SORTING> the sorting direction set with set_sorting

<DATETIMEFORMAT>

<DATEFORMAT>

<TIMEFORMAT>

if this datasource is part of a hk_presentation also the following tags will be stored

<UPN> the unique presentation number. See presentationnumber

<DEPENDING_ON> the depending on datasource set with set_depending_on_presentationdatasource

one or more <DEPENDINGFIELDS> sections with the following tags

<THISFIELD> set with add_depending_fields

<MASTERFIELD> set with add_depending_fields

Parameters:

s | the stream to which the data will be written
saveall | if true the section <DATASOURCEEXTRA> will be stored additionally to the normal data

Reimplemented from hk_class.

void loaddata (const hk_string& definition,bool loadsql=true)

### loaddata

loads the object's values out of the definition string.

Reimplemented from hk_class.

long presentationnumber (void)

### presentationnumber

[const]

if the datasource is part of a hk_presentation each datasource gets a unique datasource number as an identifier

Returns: the unique datasource number if part of a presenation else -1

bool datasource_used (void)

### datasource_used

[const]

Returns: true if a hk_visible object or a depending datasource is using this datasource else false

void dump_data ()

### dump_data

[virtual]

prints all data of this datasource to the standard output

bool ask_name (void)

### ask_name

asks interactively for a name

bool delete_rows (unsigned long from,unsigned long to,bool check_depending_datasources=true,bool ask=true)

### delete_rows

Delete rows beginning from row number "from" to row number "to"

void transaction_begin (hk_string name="")

### transaction_begin

Start a transaction. If the SQL server does not support transaction this function does nothing

Parameters:

name | the name of the transaction

void transaction_commit (hk_string name="")

### transaction_commit

Commits a transaction. If the SQL server does not support transaction this function does nothing

Parameters:

name | the name of the transaction

void transaction_rollback (hk_string name="")

### transaction_rollback

Undo a transaction. If the SQL server does not support transaction this function does nothing

Parameters:

name | the name of the transaction

void set_blockvisiblesignals (bool v)

### set_blockvisiblesignals

if true no visual objects will be informed when data changes in any kind, except the datasource will be deleted Default is false

bool blockvisiblesignals (void)

### blockvisiblesignals

void set_blockserversignals (bool)

### set_blockserversignals

if true no data will be sent to the database server when data changes in any kind Default is false

bool blockserversignals (void)

### blockserversignals

void set_blockdatasourcesignals (bool)

### set_blockdatasourcesignals

if true no depending datasources will be informed when data changes in any kind Default is false

bool blockdatasourcesignals (void)

### blockdatasourcesignals

void save_datasourcedefinition (ostream& s)

### save_datasourcedefinition

stores the structure of the datasource (fields,indices) in an xml format file and is database driver independent

bool load_datasourcedefinition (const hk_string& definition,bool use_xmltablename=true ,bool ask=true)

### load_datasourcedefinition

loads the structure of the datasource (fields,indices) in an xml format file and creates the tableand is database driver independent

hk_presentation* presentation (void)

### presentation

void set_position (int x,int y, bool registerchange=true)

### set_position

the position will be used for the database designer GUI. Mostly you don't have to manipulate the values

void set_size (int width,int height, bool registerchange=true)

### set_size

the size will be used for the database designer GUI. Mostly you don't have to manipulate the values

int x (void)

### x

[const]

int y (void)

### y

[const]

int width (void)

### width

[const]

int height (void)

### height

[const]

bool p_casesensitive

### p_casesensitive

[protected]

hk_datasource (hk_database* db,hk_presentation* p=NULL)

### hk_datasource

[protected]

if database driver supports cassensitive column and table names p_casesensitive is true else p_casesensitive is false. Then internally column_by_name() and name() return values in small letters

void column_remove (hk_column* col)

### column_remove

[protected]

void visible_add (hk_dsvisible* v)

### visible_add

[protected]

void visible_remove (hk_dsvisible* v)

### visible_remove

[protected]

void driver_specific_transaction_begin (hk_string)

### driver_specific_transaction_begin

[protected virtual]

void driver_specific_transaction_commit (hk_string)

### driver_specific_transaction_commit

[protected virtual]

void driver_specific_transaction_rollback (hk_string)

### driver_specific_transaction_rollback

[protected virtual]

unsigned long driver_specific_max_rows (void)

### driver_specific_max_rows

[protected virtual]

bool driver_specific_set_accessmode (enum_accessmode)

### driver_specific_set_accessmode

[protected virtual]

bool driver_specific_batch_enable (void)

### driver_specific_batch_enable

[protected virtual]

bool driver_specific_batch_disable (void)

### driver_specific_batch_disable

[protected virtual]

bool driver_specific_batch_goto_next (void)

### driver_specific_batch_goto_next

[protected virtual]

bool driver_specific_batch_goto_previous (void)

### driver_specific_batch_goto_previous

[protected virtual]

bool driver_specific_enable (void)

### driver_specific_enable

[protected virtual]

has to make sure that the columns-list has been created. It also has to provide access to the data of the datasource

bool driver_specific_disable (void)

### driver_specific_disable

[protected virtual]

list<hk_column*>* driver_specific_columns (void)

### driver_specific_columns

[protected virtual]

returns a list of the columns of the datasource. If the datasource is a table the list hast to be created even if the datasource is disabled. Fill the p_columns list for this reason and then return it. If necessary has to create one hk_column object per column and to add them to p_columns. Each column object has to get a unique number in its (protected) hk_column::p_fieldnr .

bool driver_specific_goto_row (unsigned long r)

### driver_specific_goto_row

[protected virtual]

hk_column* driver_specific_new_column (void)

### driver_specific_new_column

[protected virtual]

bool driver_specific_update_data (void)

### driver_specific_update_data

[protected virtual]

bool driver_specific_delete_data_at (unsigned long)

### driver_specific_delete_data_at

[protected virtual]

bool driver_specific_insert_data (void)

### driver_specific_insert_data

[protected virtual]

bool driver_specific_create_table_now (void)

### driver_specific_create_table_now

[protected virtual]

bool driver_specific_alter_table_now (void)

### driver_specific_alter_table_now

[protected virtual]

void driver_specific_before_drop_table (void)

### driver_specific_before_drop_table

[protected virtual]

void filelist_changes (filetype t)

### filelist_changes

[protected virtual]

Reimplemented from hk_data.

list<indexclass>* driver_specific_indices (void)

### driver_specific_indices

[protected virtual]

bool driver_specific_drop_index (const hk_string& i)

### driver_specific_drop_index

[protected virtual]

bool driver_specific_create_index (const hk_string& name,bool unique,list<hk_string>& fields)

### driver_specific_create_index

[protected virtual]

void before_connection_disconnects (void)

### before_connection_disconnects

[protected virtual]

Reimplemented from hk_data.

void before_source_vanishes (void)

### before_source_vanishes

[protected virtual]

Reimplemented from hk_data.

void depending_ds_add (hk_datasource* d)

### depending_ds_add

[protected]

void depending_ds_remove (hk_datasource* d)

### depending_ds_remove

[protected]

void depending_on_datasource_row_change (bool take_changed_data=false)

### depending_on_datasource_row_change

[protected]

void depending_on_datasource_data_has_changed (void)

### depending_on_datasource_data_has_changed

[protected]

void depending_on_datasource_after_store_changed_data (void)

### depending_on_datasource_after_store_changed_data

[protected]

void depending_on_datasource_insertmode (void)

### depending_on_datasource_insertmode

[protected]

bool depending_on_datasource_deleterow_ok (void)

### depending_on_datasource_deleterow_ok

[protected]

bool depending_on_datasource_before_delete_row (void)

### depending_on_datasource_before_delete_row

[protected]

bool depending_on_datasource_updaterow_ok (void)

### depending_on_datasource_updaterow_ok

[protected]

void depending_on_datasource_before_update_row (void)

### depending_on_datasource_before_update_row

[protected]

void depending_on_datasource_after_update_row (void)

### depending_on_datasource_after_update_row

[protected]

void reload_data (bool take_changed_data=false)

### reload_data

[protected]

void create_actual_row_where_statement (void)

### create_actual_row_where_statement

[protected]

hk_string create_row_where_statement_at (unsigned long int position,bool withwhere=true)

### create_row_where_statement_at

[protected]

void create_new_sql_statement (bool take_changed_data=false)

### create_new_sql_statement

[protected]

hk_string whole_datasource_where_statement (bool take_changed_data=false)

### whole_datasource_where_statement

[protected]

void print_sql (void)

### print_sql

[protected]

bool p_enabled

### p_enabled

[protected]

bool p_readonly

### p_readonly

[protected]

bool p_primary_key_used

### p_primary_key_used

[protected]

bool p_ignore_changed_data

### p_ignore_changed_data

[protected]

void clear_columnlist (void)

### clear_columnlist

[protected]

void clear_modecolumnlists (void)

### clear_modecolumnlists

[protected]

void clear_visiblelist (void)

### clear_visiblelist

[protected]

void parse_sql (void)

### parse_sql

[protected]

bool update_row (enum_interaction c=interactive)

### update_row

[protected virtual]

bool insert_row (enum_interaction c=interactive)

### insert_row

[protected virtual]

bool delete_row (enum_interaction c=interactive)

### delete_row

[protected virtual]

unsigned long p_counter

### p_counter

[protected]

hk_database* p_database

### p_database

[protected]

list<hk_column*>* p_columns

### p_columns

[protected]

typedef class --

### --

[protected]

list<class_altercolumns> p_altercolumns

### p_altercolumns

[protected]

list<hk_string> p_deletecolumns

### p_deletecolumns

[protected]

list<hk_column*> p_newcolumns

### p_newcolumns

[protected]

list<hk_string> depending_this_fields

### depending_this_fields

[protected]

list<hk_string> depending_master_fields

### depending_master_fields

[protected]

typedef class --

### --

[protected]

struct_parsed_sql is needed for parsing th SQL-statement in hk_datasource

struct_parsed_sql* p_parsed_sql

### p_parsed_sql

[protected]

hk_string p_sql

### p_sql

[protected]

hk_string p_actual_row_where

### p_actual_row_where

[protected]

bool p_automatic_data_update

### p_automatic_data_update

[protected]

hk_actionquery* p_actionquery

### p_actionquery

[protected]

hk_string p_datetimeformat

### p_datetimeformat

[protected]

hk_string p_dateformat

### p_dateformat

[protected]

hk_string p_timeformat

### p_timeformat

[protected]

hk_string p_sql_delimiter

### p_sql_delimiter

[protected]

hk_string p_true

### p_true

[protected]

hk_string p_false

### p_false

[protected]

bool p_tablesql_set

### p_tablesql_set

[protected]

void set_has_changed (void)

### set_has_changed

[protected]

void set_has_not_changed (void)

### set_has_not_changed

[protected]

- Version: $Revision: 1.64 $
- Author: Horst Knorr (hk_classes@knoda.org)
- Generated: horst on horstnotebook on Tue Mar 30 19:06:43 2004, using kdoc 2.0a54.