Microsoft Vbscript Compilation Error Expected Literal Constant
To correct this error Do not use expressions when declaring constants. See AlsoReferenceConst Statement (VBScript)ConceptsConstants (VBScript)VBScript Constants
Need Help about VBScript? Download VbsEdit! This package includes VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit.The evaluation version never expires. Home Copyright © 2001-2016 AdersoftForum Other Programming Scripting - Client Side Can anybody give me further details about the message:"Expected literal constant" If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login 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 2 of 2 Thread: Can anybody give me further details http://www.vbsedit.com/html/0be9852c-97bf-44a9-9980-7a597225b2f8.asp about the message:"Expected literal constant" Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode January 26th, 2003,06:27 PM #1 mpoincare View Profile View Forum Posts Member Join Date Nov 2002 Posts 90 Can anybody give me further details about the message:"Expected literal constant" I am trying to http://forums.codeguru.com/showthread.php?228191-Can-anybody-give-me-further-details-about-the-message-quot-Expected-literal-constant-quot add a new record in a ms access database located in the following physical path: C\Inetpub\wwwroot\plea\data\project.mdb on a windows2000 server. I a using the following ASP code in order to do that: <% Dim conn, sConnection Const DB_CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Data Source=" & Server.MapPath("project.mdb") & ";" Session.TimeOut=60 Set conn = Server.CreateObject("ADODB.Connection") conn.Open(DB_CONNECTIONSTRING) %> But the browser keeps displaying this error message: Technical Information (for support personnel) Error Type: Microsoft VBScript compilation (0x800A0415) Expected literal constant /Plea/Data/AppLogic.asp, line 6, column 54 & "Data Source=" & Server.MapPath("project.mdb") & ";" -----------------------------------------------------^ Can somebody explain me what the statement:"Expected literal constant" means in a context like that and what can be done to fix it. I also tried to use the Physical path to reach the database ( C\Inetpub\wwwroot\plea\data\project.mdb) and I still get the same message. I am using IE4 (or IE5) Reply With Quote January 27th, 2003,04:49 AM #2 Thread1 View Profile View Forum Posts Elite Member Join Date Jan 2003 Location 7,107 Islands Posts 2,487 Check out on how you declare your constant variable! Constant variable should contain only lit
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 Receive Real-Time https://www.experts-exchange.com/questions/10262919/constants.html 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 Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > constants Want to Advertise Here? Solved constants Posted on 2000-01-20 ASP 1 Verified Solution 2 Comments microsoft vbscript 1,294 Views Last Modified: 2012-08-13 Hi, Im using this code in my asp file <% cosnt base_Number = 0 const base_Number_One = base_Number + 1 const base_Number_Two = base_Number + 2 %> When I run this code I get the following error message. Microsoft VBScript compilation error '800a0415' Expected literal constant /myProject/MyAsp.inc, line 9 const base_Number_Two = microsoft vbscript compilation base_Number + 2 ---------------------------------------^ Any Idea why? Suden 0 Question by:suden Facebook Twitter LinkedIn Google LVL 5 Best Solution bymayhew From MSDN (VBScript-Const), (note the last sentence) "You can't use variables, user-defined functions, or intrinsic VBScript functions (such as Chr) in constant declarations. By definition, they can't Go to Solution 2 Comments LVL 5 Overall: Level 5 ASP 1 Message Accepted Solution by:mayhew2000-01-20 From MSDN (VBScript-Const), (note the last sentence) "You can't use variables, user-defined functions, or intrinsic VBScript functions (such as Chr) in constant declarations. By definition, they can't be constants. You also can't create a constant from any expression that involves an operator, that is, only simple constants are allowed. " 0 LVL 1 Overall: Level 1 Message Author Comment by:suden2000-01-20 Thanks Suden 0 Write Comment First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. Comment Submit Your Comment By clicking you are agreeing to Experts Exchange's Terms of Use. F