Linked text and queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have 2 linked text tables. When i try to get selected fields from these
tables combined, Access asks me for parameter values for the second table's
fields.
If i hit enter and leave them blank the result i get is correct field values
for the 1'st table's fields, but blank on the 2nd's where they should be
values from the 2nd table.
The query works fine if the tables are local (not linked, but regular
databases).
Here's a sample of the SQL (some of the field names are in Greek with latin
characters, so don't be confused).

SELECT Dimos.ID, Dimos.ID_Dimou, Dimos.Onoma_dimou, Dimos.ET_OK,
Dimos.ET_Total, Dimos.Population, Dimos.Registered, Dimos.Voted, Dimos.Egyra,
Dimos.Nomarxia_Dimou, Dimos.Time_stamp, Ypopsifioi_Dimou.Onoma_Ypopsif,
Ypopsifioi_Dimou.Psifoi, Ypopsifioi_Dimou.Pososto, Ypopsifioi_Dimou.Eklogi,
Ypopsifioi_Dimou.Aperxomenos, Ypopsifioi_Dimou.Onoma_Syndiasmou,
Ypopsifioi_Dimou.Ypostirixi
FROM Dimos INNER JOIN Ypopsifioi_Dimou ON Dimos.ID_Dimou =
Ypopsifioi_Dimou.ID_Dimou
GROUP BY Dimos.ID, Dimos.ID_Dimou, Dimos.Onoma_dimou, Dimos.ET_OK,
Dimos.ET_Total, Dimos.Population, Dimos.Registered, Dimos.Voted, Dimos.Egyra,
Dimos.Nomarxia_Dimou, Dimos.Time_stamp, Ypopsifioi_Dimou.Onoma_Ypopsif,
Ypopsifioi_Dimou.Psifoi, Ypopsifioi_Dimou.Pososto, Ypopsifioi_Dimou.Eklogi,
Ypopsifioi_Dimou.Aperxomenos, Ypopsifioi_Dimou.Onoma_Syndiasmou,
Ypopsifioi_Dimou.Ypostirixi
HAVING (((Dimos.ID_Dimou)=350));

Running it, Access asks me for parameter values for all the fields of the
Ypopsifioi_Dimou table, which is not what i'm expecting...

Hope i made sense, and please forgive the long post,
thanks
 
Kosta,

I can't think of an apparent reason for this, possibly just a bug
somewhere in your .mdb? If you want, you are welcome to mail me your
..mdb and the text files (zipped please!) to have a look... just do the
obvious with the address in the post header.

Nikos
 
I have 2 linked text tables. When i try to get selected fields from these
tables combined, Access asks me for parameter values for the second table's
fields.

Try relinking the second table. It sounds like it has mislaid its
fieldnames - perhaps the fields are named 1, 2, 3...?

If you open the linked second table in design view, do you see the
expected fieldnames?

John W. Vinson[MVP]
 
Hello John,
These 2 tables are coming from the same text file. The reason i make 2
tables (and links) is that in this file are two types of records and each
type has different field size.
Now it's essential to make a relationship between these tables (FROM Dimos
INNER JOIN Ypopsifioi_Dimou ON Dimos.ID_Dimou = Ypopsifioi_Dimou.ID_Dimou).
If i make this relationship and run the query, apart from the above
described (blank fields etc.) if i open the 2nd table it's blank (!!)...
If i don't make a relationship i get of course wrong query results, but the
table stays intact...
Relinking the (blank) table works until the query re-runs, when it blanks
again the table....
The fields do not change name at all...

Any ideas???
Thanks for your time
 
Relinking the (blank) table works until the query re-runs, when it blanks
again the table....
The fields do not change name at all...

Any ideas???
Thanks for your time

That's VERY odd. Any chance you could Import the table (perhaps into a
linked second .mdb file to avoid bloat) and base your query on an
Access table, rather than the linked text file?


John W. Vinson[MVP]
 
Importing the table works fine, but it's essential to link the table, because
the data provider (the text file) re-sends the text file overwriting the old
one with new data.
So to keep the database updated the file must be linked.
It's easy to reproduce it, if you make a fixed-width text file with 10
records -5 with 4 fields and field specs "A" and 5 with 5 fields and field
specs "B", and make 2 linked tables with each spec.
Try then to make a query that gets 2 or 3 fields from table A and 2-3 from
table B.

Does it work???
 
Back
Top