Patch level : 2.2

Files correlati     : ba8
Ricompilazione Demo : [ ]
Commento            :
Usate classi di supporto ODBC in generatore query e report


git-svn-id: svn://10.65.10.50/trunk@13455 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2005-10-25 16:53:27 +00:00
parent 099c9bc2f2
commit 7fcf9ccfb4
2 changed files with 25 additions and 28 deletions

@ -5,6 +5,7 @@
#include <defmask.h>
#include <extcdecl.h>
#include <modaut.h>
#include <odbcrset.h>
#include <prefix.h>
#include <progind.h>
#include <recset.h>
@ -863,23 +864,22 @@ bool TQuery_mask::ask_vars(const char* maskname, TRecordset& recset) const
TRecordset* TQuery_mask::new_recordset() const
{
const TString& sql = get(F_SQL);
TRecordset* rex = NULL;
if (sql.starts_with("SELECT "))
rex = new TSQL_recordset(sql);
else
rex = new TISAM_recordset(sql);
TRecordset* rex = create_recordset(sql);
if (!ask_vars(get(F_CODICE), *rex))
if (rex != NULL)
{
delete rex;
rex = NULL;
}
if (!ask_vars(get(F_CODICE), *rex))
{
delete rex;
rex = NULL;
}
if (rex != NULL && rex->columns() == 0)
{
warning_box(TR("Nessuna riga risultato"));
delete rex;
rex = NULL;
if (rex != NULL && rex->items() == 0)
{
warning_box(TR("Nessuna riga risultato"));
delete rex;
rex = NULL;
}
}
return rex;

@ -6,6 +6,7 @@
#include <defmask.h>
#include <execp.h>
#include <modaut.h>
#include <odbcrset.h>
#include <prefix.h>
#include <printer.h>
#include <reprint.h>
@ -953,23 +954,19 @@ bool TReport_mask::on_field_event(TOperable_field& o, TField_event e, long jolly
case F_SHOW_QRY:
if (e == fe_button)
{
TRecordset* rex = NULL;
const TString& sql = get(F_SQL);
if (sql.starts_with("SELECT "))
rex = new TSQL_recordset(sql);
else
rex = new TISAM_recordset(sql);
if (rex->columns() > 0)
TRecordset* rex = create_recordset(sql);
if (rex != NULL)
{
TRecordset_sheet sht(*rex);
sht.run();
if (rex->items() > 0)
{
TRecordset_sheet sht(*rex);
sht.run();
}
else
warning_box(TR("Nessuna riga risultato"));
delete rex;
}
else
warning_box(TR("Nessuna riga risultato"));
delete rex;
}
break;
case DLG_PRINT: