Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP/VB write error

Status
Not open for further replies.

AudieC

Programmer
Nov 28, 2003
2
0
0
US
I have a lot of programming experience, but not very much in the ASP field. I am using IIS 5.1. I am using Visual Basic 6 to create an IIS application. The problem is that im getting an error when the asp tries to write a file. I am trying to write to "... The error occurs in the function:

Public Function GetCountFromText(TextPath As String) As String

Open TextPath For Binary Access Read As #1
GetCountFromText = String(LOF(1), Chr(0))
Get #1, 1, GetCountFromText
Close #1

GetCountFromText = Trim(GetCountFromText)

Open TextPath For Binary Access Write As #1
Put #1, 1, GetCountFromText + 1
Close #1

End Function

If i take this part out it works:

Open TextPath For Binary Access Write As #1
Put #1, 1, GetCountFromText + 1
Close #1

but i have to have that in there because it adds to the counter. This worked before, but then I had to reinstall windows and i am getting this error. It puzzles me. I have a lot of other things that are dependent on writing to files, so I have errors on a lot of my pages. Is there some sort of setting in IIS that keeps the ASPs from being able to write. If you need anymore information then just say. I really appreciate your time and thanks. :)
 
The account under which your IIS application runs, must have the proper permissions to access these files. Typically, your IIS applications will run under the IUSR_MACHINENAME account. The files/folders you are trying to access, must have their permissions explicitly set to allow this user full access.

good luck!
-f!
 
Well, I figured I would have to do something along those lines and I did that before, but maybe not in the right place. I go into Control panel/admin tools/internet information services. In there I expand the websites folder and then expand the default web site. There it shows me all the files and folders inside the folder and some virtual directories. Well i right click on the files folder and go to properties and a dialog appears with the directory tab up. There is a section that has the options read/write/script access/ect. well i have read, write, and script access selected. i would think this would do it, but for some reason it does not...thanks for the help dude, hope you can help me get this figured out....thanks
 
in windows explorer, try right-clicking on the folder/files in question, select properties, then go to security. in that dialog, you will want to add a user (named IUSR_MACHINENAME) and give that user full permissions. as your web pages are executed, they are done so under this IUSR user, so this user must have the proper permissions to affect any files.

good luck!
-f!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top