I am working with classic ASP (not by choice) and I am attempting to create a Log File for each day of operation.
First I check to make sure that the file exists
If it does then I open the file to append some data at the end of the file
If it doesn't I create the file and add some data to it.
My problem is when I attempt to open the existing file to append some data to it. I've looked all over the internet to see what the problem is but my code seems to be fine. Can some one take a look at the code and tell me what is wrong with it?
Here is me code
Here is the error that I am receiving:Code:Set LogDFS=Server.CreateObject("Scripting.FileSystemObject")
'Checking to see if the file exists
If LogDFS.FileExists(strOutputFile) Then
'The File exists, so it will be opened and data will be added to the end of the file
Set LogDFO=LogDFS.GetFolder("X:\Customers\Wellness\Amazon_results\LogFiles")
Set LogFile=LogDFO.OpenTextFile("X:\Customers\Wellness\Amazon_results\LogFiles\" & SelectDay & ".txt", 8)
'The file does not exist, so it will be created
Else
Set LogDFO=LogDFS.GetFolder("X:\Customers\Wellness\Amazon_results\LogFiles")
Set LogFile=LogDFO.CreateTextFile(SelectDay&".txt", true)
LogFile.writeline(Now() & " File Created")
LogFile.writeline("*************************************")
End If
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'OpenTextFile'
/AmazonTest/AmazonTest.asp, line 19
I think maybe I just need another set of eyes to look at the code..
