// **************************************************************************** // copyright (c) 2000-2005 Horst Knorr // This file is part of the hk_paradoxclasses library. // This file may be distributed and/or modified under the terms of the // GNU Library Public License version 2 as published by the Free Software // Foundation and appearing in the file COPYING included in the // packaging of this file. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // **************************************************************************** #include "hk_paradoxdatasource.h" #include "hk_paradoxdatabase.h" #include "hk_paradoxconnection.h" #include "hk_paradoxcolumn.h" #include "hk_string.h" #include #include static hk_string errormsg; void errorhandler(pxdoc_t *, int , const char *str, void *) { cerr << "PXLib:"<* hk_paradoxdatasource::driver_specific_columns(void) { return p_columns; } bool hk_paradoxdatasource::driver_specific_create_columns(void) { clear_columnlist(); p_columns=new list; return true; } bool hk_paradoxdatasource::driver_specific_batch_enable(void) { if (!datasource_open()) return false; if (accessmode()==batchwrite) return true; p_counter=0; if (datasource_fetch_next_row()) set_maxrows(1); else set_maxrows(0); return true; } bool hk_paradoxdatasource::driver_specific_batch_disable(void) { return datasource_close(); } bool hk_paradoxdatasource::driver_specific_batch_goto_next(void) { try { if (datasource_fetch_next_row()) { set_maxrows(max_rows()+1); ++p_counter; return true; } else return false; } catch (std::bad_alloc errormessage) { datasource_close(); return false; } } bool hk_paradoxdatasource::datasource_open(void) { return true; } bool hk_paradoxdatasource::datasource_fetch_next_row(void) { return true; } bool hk_paradoxdatasource::datasource_close(void) { return true; }