Patch level : 12.00 1326
Files correlati : ca0.exe cg0.exe ve0.exe Inivo a CRM Chiusura commesse fino all'anno
This commit is contained in:
parent
33124b2cdb
commit
3aaeb6c48b
@ -731,20 +731,40 @@ HIDDEN void odbc_send(const TString & dsn, int num, TAuto_token_string & elab_fi
|
||||
int nfields = wrk.fields();
|
||||
const TString name = table_name(curr_file_num, mssql);
|
||||
TToken_string key(wrk.keydef(), '+');
|
||||
TString check_statement = "SHOW TABLES LIKE '";
|
||||
|
||||
int err = 0;
|
||||
|
||||
if (mssql)
|
||||
{
|
||||
TString sqlname = name.mid(1, name.len() - 2);
|
||||
TString check_statement = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = '";
|
||||
|
||||
check_statement = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = '";
|
||||
check_statement << sqlname << "';";
|
||||
int err = recset.exec(check_statement);
|
||||
}
|
||||
else
|
||||
{
|
||||
HIDDEN int __magic_find_tables = -2;
|
||||
|
||||
if (__magic_find_tables == -2)
|
||||
__magic_find_tables = ini_get_bool(CONFIG_STUDIO, "Main", "MAGIC_FIND_TABLES");
|
||||
|
||||
if (__magic_find_tables)
|
||||
{
|
||||
TString check_statement = "SELECT * FROM ";
|
||||
|
||||
check_statement << name << ";";
|
||||
err = recset.exec(check_statement);
|
||||
err = err == -1146 ? 0 : 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
TString check_statement = "SHOW TABLES LIKE '";
|
||||
|
||||
check_statement << name << "';";
|
||||
|
||||
int err = recset.exec(check_statement);
|
||||
|
||||
err = recset.exec(check_statement);
|
||||
}
|
||||
}
|
||||
if (err <= 0)
|
||||
{
|
||||
create_table(recset, curr_file_num, name, wrk);
|
||||
|
Loading…
x
Reference in New Issue
Block a user