From 26e0a03c6778b2c887c27a3870ebd8784202ee11 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 7 Apr 2009 13:53:49 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : ca3 Ricompilazione Demo : [ ] Commento : Aggiunto supporto per query su file dbf esterni git-svn-id: svn://10.65.10.50/trunk@18677 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/recset.cpp | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) 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());