Why Do I get Path/File Access Error On User's Computers When I Try ToCreate a Text File?

R

R Tanner

I am trying to run the following code to create a text file when the
user selects a button.

Public Sub CreateCredentials()
Dim FileNum As Integer, MyFile As String
FileNum = FreeFile
MyFile = "C:\Documents and Settings\Default User\Application Data
\Identities\Credentials.LOG"

Open MyFile For Append As #FileNum

Print #FileNum, "UserName: " & Forms![frmMain]![User]
Print #FileNum, "Password: " & Forms![frmMain]![PWord]

Close #FileNum

End Sub

I get a Path/File Access error on some machines when I try to run
this. Any ideas why?
 
R

R Tanner

I am trying to run the following code to create a text file when the
user selects a button.

Public Sub CreateCredentials()
Dim FileNum As Integer, MyFile As String
FileNum = FreeFile
MyFile = "C:\Documents and Settings\Default User\Application Data
\Identities\Credentials.LOG"

Open MyFile For Append As #FileNum

Print #FileNum, "UserName: " & Forms![frmMain]![User]
Print #FileNum, "Password: " & Forms![frmMain]![PWord]

Close #FileNum

End Sub

I get a Path/File Access error on some machines when I try to run
this. Any ideas why?

This seems to happen on everyone's machine but mine. Of course,
everyone else's computers are much different. I have admin rights and
stuff and they are locked down TIGHT. lol
 
T

Tom van Stiphout

On Wed, 7 Jan 2009 12:18:50 -0800 (PST), R Tanner

Check if such user can create a Notepad file and save it to this same
location. If not, that's your answer.

-Tom.
Microsoft Access MVP

I am trying to run the following code to create a text file when the
user selects a button.

Public Sub CreateCredentials()
Dim FileNum As Integer, MyFile As String
FileNum = FreeFile
MyFile = "C:\Documents and Settings\Default User\Application Data
\Identities\Credentials.LOG"

Open MyFile For Append As #FileNum

Print #FileNum, "UserName: " & Forms![frmMain]![User]
Print #FileNum, "Password: " & Forms![frmMain]![PWord]

Close #FileNum

End Sub

I get a Path/File Access error on some machines when I try to run
this. Any ideas why?

This seems to happen on everyone's machine but mine. Of course,
everyone else's computers are much different. I have admin rights and
stuff and they are locked down TIGHT. lol
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top