lookup or connect to a csv

Happy YN

Registered User.
Local time
Today, 10:30
Joined
Jan 27, 2002
Messages
425
I have seen much of the forum re csv etc but have not seen anything similar to my question!

my csv looks like this (actual values substituted for ease!)

xName,yName,zname
hello,hi,bye
good,better,worse
57,90,87


The first 'column' is always different -no duplicates
I need from within access to do a lookup e.g

get the 'n'th value on the line beginning hello

I prefer not to have to import the csv into a table and then read from it, I just want vba to read from it where it is. The csv is constantly changing

Any ideas
Thanks!!
 
There are several ways in which this can be accomplished in Visual Basic, but the right one greatly depends on the specific requirements of the application.

What exactly is it that you are trying to accomplish? Can you give some more specifics? Concrete examples? We can appreciate your simplifying your question for the sake of ease, but perhaps the way you presented it is a little TOO simplified?
 
Thanks for your interest!
I want to link to it very much like a linked table so that I can almost query it
e.g if I have a string , I can lookup that string down the first column and return the value of the next column along (or 2 or 3 columns along)
I am using column to describe each comma separated value
Thanks again
Added: I know I could use transfertext to create a link physically but firstly a csv file is not one of the datatypes allowed in vba to link to, secondly I'd rather not create a physical link, I just want to refer to that file as an external file
 
Last edited:
If you want to refer to the CSV file as a linked table, you will have to use a physical link, period.
 
I could also create the link when needed using transfertext and then delete it afterwards (all in code)
 

Users who are viewing this thread

Back
Top Bottom