Microsoft Vbscript Runtime Error Illegal Assignment
name + Ask a Question Need help? Post your question and get tips & solutions from a community of 418,590 IT Pros & Developers. It's quick & easy. Microsoft VBScript runtime (0x800A01F5): Illegal assignment: variable name P: n/a Matt <% hour = Request("controlname") %> will yield the following error: Microsoft VBScript runtime (0x800A01F5) Illegal assignment: 'hour' However, if I declare hour, then it is fine. <% Dim hour hour = Request("controlname") %> But I think in VBScript, declaration of a variable is optional? That means we can use the variable without writing "Dim hour" ?? Please advise! thanks! Jul 19 '05 #1 Post Reply Share this Question 3 Replies P: n/a Gervin If u use a variable name that is NOT a function name as well, then u don't have to declare it. Hour( ) is a built-in function. "Matt"
Illegal assignmentVery tricky error. The clue is in the name after Error: in the message box. Introduction to Code 800A01F5 Error code, 800A01F5 occurs when you execute a VBScript. This is a runtime error, check your objects and strings. The Symptoms You Get The script does not execute as you had hoped. Instead you get a WSH message box like this picture: The Cause of Error 800A01F5 Your VBScript contain is a misuse of a string or object variable. The clue here is in the 'strComp'. What could be wrong? In the case of this WSH error the logic is faulty, what is required is an object property, not a str = https://bytes.com/topic/asp-classic/answers/55385-microsoft-vbscript-runtime-0x800a01f5-illegal-assignment-variable-name string property. Paul DeBrino also reports that trying to set a variable which had previously been defined as CONST also results in Error 800A01F5.Incidentally, Source: reports a runtime error not a compilation error, this means you are looking not for a pure syntax problem, but a fault logic error. In the case of runtime errors, you can use this temporary work around. Add this statement just before the line which errors: On Error http://www.computerperformance.co.uk/Logon/code/code_800A01F5.htm Resume Next. The Solutions Check the syntax of your script. In my VBScript example line 7 is the problem. With WSH error messages, Char 1, is often unreliable, the problem could be anywhere on that line. Check your variables, none should also be CONST. As a last resort, in the case of runtime errors, you can add this line: On Error Resume Next. ‡ Example of Error 800A01F5 Script Note: The Line: 7 strComp = OurNetwork.Username. The problem is that you cannot set a variable to be equal to this particular property (.Username). As the error messages says, this is an illegal assignment. ' Error 800A01F5 VBScript to to Enumerate your mapped drive ' Guy Thomas February 2010. ' ****************************** Set OurNetwork = WScript.CreateObject("WScript.Network") Set objDrives = OurNetwork.EnumNetworkDrives ' WScript.Echo OurNetwork.Username &" 's Network drive mappings:" strComp = OurNetwork.Username WScript.Echo strComp WScript.Quit See More Windows Update Error Codes 8004 Series • Error 800A101A8 Object Required • Error 800A0046 • Error 800A10AD • Error 800A000D • Error 80048820 • Error 800A0401 • Review of SolarWinds Permissions Monitor • Error 80040E14 • Error 800A03EA • Error 800A0408 • Error 800A03EE Guy Recommends: WMI Monitor and It's Free! Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems. Fortunately, SolarWinds have created the
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help https://www.experts-exchange.com/questions/21792673/Microsoft-VBScript-runtime-error-'800a01f5'-Illegal-assignment.html Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts http://www.vbforums.com/showthread.php?668225-RESOLVED-Error-Illegal-Assignment-shell-Using-Appactivate Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Microsoft VBScript runtime error '800a01f5' Illegal assignment Want to Advertise Here? Solved microsoft vbscript Microsoft VBScript runtime error '800a01f5' Illegal assignment Posted on 2006-03-28 ASP 1 Verified Solution 1 Comment 3,155 Views Last Modified: 2008-01-09 This page is supposed to add a new category to a table in my database. When I submit the form to add the new category I get the following error: Microsoft VBScript runtime error microsoft vbscript runtime '800a01f5' Illegal assignment: 'doSaveEditCat' /catFuncs.asp, line 76 Despite this the category is successfully added to the database. Can anyone tell me why I get this error? I have included the referenced code below: '--Function: Add a new category function doSaveAddNewCat(catname, parent) Dim sqltext Dim retVal if (len(parent) = 0) Then parent = 0 end if sqltext = "INSERT INTO tblCategoryNew (Category, Parent) VALUES ('" & dbSafeString(catname) & "'," & parent & ")" retVal = doDBWrite(sqltext) writeLogEntry "Add New", "Directory Category", now, dbSafeString(catname), session("User_FirstName") & " " & session("User_Lastname"), sqltext doSaveEditCat = retVal end function Also, when I try to delete categories I get a "page can not be found" page and the category does not get deleted. I don't know if these two issue are related, but the following code may help with the second problem: '--Function: Delete a category function doDeleteCat(catID) Dim retVal Dim lrecords Dim sqltext Dim parent retVal = "" parent = getParentID(catID) sqltext = "DELET
Using Appactivate If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: [RESOLVED] Error: Illegal Assignment: 'shell' Using Appactivate Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Dec 24th, 2011,06:44 AM #1 steve.marks59 View Profile View Forum Posts Thread Starter Junior Member Join Date Apr 2010 Posts 18 [RESOLVED] Error: Illegal Assignment: 'shell' Using Appactivate My OS is Windows XP Pro SP3 How can I combine these two VBScripts, StartYahoo.vbs and MinYahoo.vbs into one VBScript, StartYahooMin.vbs without getting an "Illegal Assignment 'shell" Error from the line below? Code: set shell = createobject("wscript.shell" These two scripts when run as separate vbs files work fine., StartYahoo.vbs: Code: 'START Yahoo Messenger sub shell(cmd) dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run(cmd) Set objShell = Nothing end sub shell """C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe""" MinYahoo.vbs: Code: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.popup "MINIMIZE Yahoo Messenger", 5 'MINIMIZE Yahoo Messenger set shell = createobject("wscript.shell") shell.AppActivate "Yahoo! Messenger" wscript.sleep 1000 success = shell.appactivate("Yahoo! Messenger") if success then shell.sendkeys "% r" '...restore wscript.sleep 1000 success = shell.appactivate("Yahoo! Messenger") if success then shell.sendkeys "% n" '...minimize wscript.sleep 1000 success = shell.appactivate("Yahoo! Messenger") if success then shell.sendkeys "% n" '...minimize But produces an error when combined into one vbs file, StartYahooMin.vbs: Code: 'START Yahoo Messenger sub shell(cmd) dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run(cmd) Set objShell = Nothing end sub shell """C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe""" wscript.sleep 25000 Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.popup "MINIMIZE Yahoo Messenger", 5 'MINIMIZE Yahoo Messenger set shell = createobject("wscript.shell") shell.AppActivate "Yahoo! Messenger" wscript.sleep 1000 success = shell.appactivate("Yahoo! Messenger") if success then shell.sendkeys "% r" '...restore wscript.sleep 1000 succes