Reading from .txt file

javajom

Javajon
Local time
Today, 22:49
Joined
Mar 5, 2008
Messages
37
Hi,
I have a function that reads from 3 arrays, which works well but the problem is that everytime I have to make changes to the database I then have to alter the function writing the names into the function. Then I have to remake the MDE file, a bit of a b**** ache. So I was wondering how easy it would be to have a .txt file containing the data so when the function ran it would get the information from that file so all I would have to do is make the arrays dynamic and get its contents from the file. Any alterations would be on the .txt file so the database would not require any work. Any ideas????
 
a) if you can format the text file the same each time, then separate items with commas, and read the text file directly into a table with docmd.transfertext

then you can examine your table - thats slightly easier than

--------
b) if its a random text file, you will have to open it with a file handle, and read lines in one at a time until you find what you are looking for.
 
What I've got is a security function that asks for a password and in that function there is 3 arrays, 1 admin, stores and schedule so when you enter your password it will/not allow you to do certain things so some things on the form will have enable off.
 
as i say, if you can put all your setting values into a single line csv file, then you can load this into a table and manage it that way. you could then populate your array etc by reading this table

then you can just change the csv file, to get different effects, without having to edit the programme
 

Users who are viewing this thread

Back
Top Bottom