diff --git a/include/recset.cpp b/include/recset.cpp index 155000bfc..16c35648d 100755 --- a/include/recset.cpp +++ b/include/recset.cpp @@ -1214,15 +1214,33 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col) if (tok.blank()) return; - int logicnum = table2logic(tok); - const TString table(tok); - if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG - logicnum = LF_TAB; - - if (logicnum == LF_TAB || logicnum == LF_TABCOM || logicnum == LF_TABMOD) - _relation = new TRelation(tok); + TString table(tok); table.upper(); + if (table.ends_with(".DBF")) + { + TFilename dbf = table; + if (dbf.is_relative_path()) + { + if (!dbf.custom_path()) + { + dbf.tempdir(); + dbf.add(table); + } + } + dbf.lower(); + TExternisamfile* eif = new TExternisamfile(dbf, true); + _relation = new TRelation(eif); + } else - _relation = new TRelation(logicnum); + { + int logicnum = table2logic(tok); + if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG + logicnum = LF_TAB; + + if (logicnum == LF_TAB || logicnum == LF_TABCOM || logicnum == LF_TABMOD) + _relation = new TRelation(tok); + else + _relation = new TRelation(logicnum); + } pop(); add_column_info(table, _relation->curr());