473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Need to read a text file from a network share

Ok, I'm brand new to IIS and asp. (My experience is with apache on Solaris but we have gotten rid of that system.) I need to readin a text file with asp that is on the C: drive of another Windows server that is not running IIS. I created a share on folder containing the text file on the second server and made it available to the Everyone Group.

The asp program, which works when the file is local, doesn't work when I modify the Server.MapPath line to use an UNC.

Expand|Select|Wrap|Line Numbers
  1. DispFile= Server.MapPath("\\190.232.176.10\\ArcGISLicenseLog\\ESRILicenseUse.txt")
  2. 'DispFile= Server.MapPath("ESRILicenseUse.txt")
  3. Set FileObject = Server.CreateObject("Scripting.FileSystemObject") 
  4. Set InStream = FileObject.OpenTextFile (DispFile) 
  5.  
From what I've read Server.MapPath doesn't work with those. How do I read a text file from a network share and is there any special permissions needed on the network share beyone the Everyone group?

Thanks
Dec 10 '10 #1
2 3920
Pheddy
80
Try mapping the network drive.
Dec 10 '10 #2
danp129
323 Expert 256MB
I don't know for sure what problems you are going to run into as I haven't tried it and don't have the right environment to test, but here's my two cents:

1) FSO does have the ability to open UNC paths as stated here. However, you may or may not have issues using the IUSR_MACHINENAME or whatever account your site is running under accessing the other computer, just have to try and see.

2) Server.MapPath shouldn't need to be used, you are already specifying the full path which is all that function returns.

3) You should only have "\\" at the beginning of the UNC path, not after the folders.
Dec 11 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: rishka | last post by:
Rishka Mar 17, 5:40 am show options Newsgroups: comp.databases.oracle.tools From: "Rishka" <ris...@webmail.co.za> - Find messages by this author Date: 17 Mar 2005 05:40:45 -0800 Local:...
3
by: Krish | last post by:
I have requirement, that i get one big chunk of text file. This text file will have has information, that on finding "****End of Information****", i have to split them individual text file with our...
5
by: Mika M | last post by:
Hi! I'm trying to read text file like... "Field1";"Field2";"Field3";"Field4" "ABCD";"EFGH";"1234";"20051020" "AABB";"CCDD";"2468";"20051021" "CCDD";"XXYY";"4321";"20051022" ....using OLE...
2
by: Tim2Be | last post by:
I have a text file that has a length of 840 bytes. I need to split into 20 bytes starting from byte 1. If there are data in any of the 20 bytes, I display the data. So there are 42 occurences of 20...
1
by: sallu2000 | last post by:
hi to all, I am new to php,can u give any idea to read text file from folder based on datewise .for eg. in that folder there are three text file. one.txt 10/3/2007 two.txt 13/3/2007...
1
by: abtet | last post by:
Hello people, I am new to php and have question on how to read text file and convert it to XML with php. . Can it be done if the text file contains text, image and also tables? please help...
1
by: neveen | last post by:
i want to open and read text file using j2me that can run on mobile 6630 then i want to make button called read that when pressed the data inside text display
6
by: portCo | last post by:
Hello there, I am creating a vb application which is some like like a questionare. Application read a text file which contains many questions and display one question and the input is needed...
5
by: dm3281 | last post by:
Hello, I have a text report from a mainframe that I need to parse. The report has about a 2580 byte header that contains binary information (garbage for the most part); although there are a...
4
by: mike91 | last post by:
Hello, I have a text file of unknown size that I need to read into a struct array where the struct looks like : { short hours float secondsPastHour float data1 float data2 } But...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.