By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,222 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,222 IT Pros & Developers. It's quick & easy.

Reading a text file

P: n/a
I know this is not really an Access question, but I can't find a more
appropriate group, and I've received such great help here in the past.

I am trying create an asp page to read a text file one line at a time.
Then, use each line as an ID to look up info via an ODBC connection.
Everything works fine as long as the text file is in the same
directory as my asp page:
Set fs=Server.CreateObject("Scripting.FileSystemObject ")

myPath = "Test.txt"

Set myFile=fs.OpenTextFile(Server.MapPath(myPath),1)

Do until myFile.AtEndOfStream
Response.Write(myFile.Readline) & "<BR>"


However, I want my users to use a text file that is not located on the
web server; rather local on their PCs. Is this possible? When I try:

myPath = "c:\myFolder\Test.txt" in the above, I get "The Path
parameter for the MapPath method must be a virtual path. A physical
path was used."

I've searched Google and MS for clues about how to do this, but
nothing seems to work. Maybe the file must be on the server(?)

Any help would be greatly appreciated.


Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.