Patch level : 4.0 nopatch

Files correlati     :  crpa0.exe
Ricompilazione Demo : [ ]
Commento     :

supporto ODBC


git-svn-id: svn://10.65.10.50/trunk@16189 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2008-02-17 20:58:48 +00:00
parent d096813c81
commit 45d6a5ffce

@ -1,6 +1,7 @@
#include <applicat.h>
#include <dongle.h>
#include <execp.h>
#include <odbcrset.h>
#include <tabutil.h>
#include <utility.h>
@ -1130,6 +1131,9 @@ void TIni2Sql::main_loop()
break;
}
int err = 0;
if (_sqlfile != NULL)
{
_sqlfile->flush();
@ -1145,6 +1149,30 @@ void TIni2Sql::main_loop()
TExternal_app esegui_sql(rigapar);
esegui_sql.run();
}
else
{
ifstream f("crpa.sql");
TString query;
TString header;
TString & buffer = get_tmp_string(4096);
char * b = buffer.get_buffer(4096);
header << "ODBC(" << _configfile->get("Connect") << ',' << _configfile->get("Username") << ',' <<_configfile->get("Password") << ")\n";
TODBC_recordset pmc40(header);
while (f.good())
{
f.getline(b, 4096);
query << buffer;
}
int err = pmc40.exec(query);
if (err != 0)
{
_inputfile->set("Result", "Error", "Transaction");
_inputfile->set("Error", err, "Transaction");
}
}
}
// non devo scrivere niente nelle tavole oracle
// ma devo comunque segnalare come eseguita la transazione altrimenti rimane nel postino