![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Why does oScript.LogEvent not like 9 I need some fresh eyes on a problem with creating an Error Log entry. If I use 1 for my entry it works. Here is a part of my code; transfermade = False Set oScript = Wscript.CreateObject("WSCRIPT.SHELL") if instr(1,transferstatus,"226 Transfer complete") Then logf.writeline "Status: Successful" logf.writeline "Attempts: " & cstr(transferattempts) transfermade=True Else logf.writeline "Status: Failed" logf.writeline "Attempts: " & cstr(transferattempts) end If logf.writeline "" Loop if not transfermade Then logf.writeline "TRANSFER FAILED for " & f1.name 'Wscript.Echo "Send e-mail here - Line 158" logf.writeline "Sending error message" If transfermade then oScript.LogEvent 4, "226 Transfer complete for: " & Cust & vbTab & ftp_filename Else oScript.LogEvent 9, "TRANSFER FAILED for xferftpfiles" end If If the FTP transfer fails, I get this error; Microsoft VBScript runtime error: Invalid procedure call or argument and it points to this line oScript.LogEvent 9, "TRANSFER FAILED for xferftpfiles" |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Why does oScript.LogEvent not like 9 "OldDog" <mikef2691@xxxxxx> wrote in message news:07ee8799-d5b7-4feb-ae34-42bdc1f4216d@xxxxxx Quote: >I need some fresh eyes on a problem with creating an Error Log entry. > If I use 1 for my entry it works. > > Here is a part of my code; > > transfermade = False > Set oScript = Wscript.CreateObject("WSCRIPT.SHELL") > if instr(1,transferstatus,"226 Transfer complete") Then > logf.writeline "Status: Successful" > logf.writeline "Attempts: " & cstr(transferattempts) > transfermade=True > Else > logf.writeline "Status: Failed" > logf.writeline "Attempts: " & cstr(transferattempts) > end If > logf.writeline "" > Loop > > if not transfermade Then > logf.writeline "TRANSFER FAILED for " & f1.name > 'Wscript.Echo "Send e-mail here - Line 158" > logf.writeline "Sending error message" > > If transfermade then > oScript.LogEvent 4, "226 Transfer complete for: " & Cust & vbTab & > ftp_filename > Else > oScript.LogEvent 9, "TRANSFER FAILED for xferftpfiles" > end If > > If the FTP transfer fails, I get this error; > > Microsoft VBScript runtime error: Invalid procedure call or argument > and it points to this line > oScript.LogEvent 9, "TRANSFER FAILED for xferftpfiles" - It has a "loop" statement without a matching "do" statement. - It has and "if" statement without a matching "end if" statement. - We don't know what value the variable "transferstatus" has and what type it is. - We don't know what you refer to when you say "if I use 1 for my entry". - We know nothing about the nature of the logf object. |
My System Specs![]() |