text file as part of a query?

DanG

Registered User.
Local time
Today, 06:08
Joined
Nov 4, 2004
Messages
477
Just a general question...
Is there a way to have the contents of a text file become included in a query.

Say I have a list of names in a text file like:
Bill
Bob
Chuck...

Can I connect to that file and have the names be part of the query?

Thank you!
 
Yes you can, but I doubt it is done very often. You can stream the text file and use plenty of different methods to read values on specific lines using ADO or ADOX. You can also read them with DAO by creating a what is called a "Free File" and opening it for Output.

Check out the Access help articles for examples on this. You can search on "Print #" or "OpenTextFile". If you're interested in ADO, you can search on something like "stream object".

It would have to be done through a function call in the query, as the query builder is incapable of doing it.
 
Thank you, I will check it out.

My intent is to use it like in(bob,dave,rob...) but the list of names would be from the text file. I could see where it would not be used too much, but I was just wondering.
 

Users who are viewing this thread

Back
Top Bottom