Microsoft Vbscript Runtime Error 800a000d Type Mismatch Formatnumber Asp
Contents |
VBScript runtime error The SitePoint Forums have moved. You can now find them here. This forum is now closed to new posts, but you can browse existing microsoft vbscript runtime error '800a000d' type mismatch 'cint' content. You can find out more information about the move and how to
Cint Vbscript
open a new account (if necessary) here. If you get stuck you can get support by emailing forums@sitepoint.com 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. SitePoint Sponsor User Tag List Results 1 to 3 of 3 Thread: Microsoft VBScript runtime error Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Oct 25, 2010,10:59 #1 pcboy View Profile View Forum Posts SitePoint Member Join Date May 2006 Location Phnom Penh, Cambodia Posts 19 Mentioned 0 Post(s) Tagged 0 Thread(s) Microsoft VBScript runtime error I am new to Asp program, when writing code i got a problem below: I dont know how to solve it. Microsoft VBScript runtime error '800a000d' Type mismatch: 'FormatNumber' /down_blogpost.asp, line 114 my code Code: MyConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/db/Blog.mdb") rs.Source = "SELECT BlogID, BlogTitle, BlogPosted, (Blog_Rates/Blog_Rates_No) as Rating, BlogLoginID, Blog_Rates, Blog_Rates_No FROM Blog Where BlogLive=0 AND BlogID="&id&"" Rating: ">.gif" weight="57" height="12" style="vertical-align: middle; border: 0;" alt="<%=(rs("BlogTitle").Value)%> Link has been Rated <%= FormatNumber((rs("RATING").Value), 1, -2, -2, -2) %> stars"> "><%=FormatNumber((rs("RATING").Value), 1, -2, -2, -2) %> - About Cambodia : Cambodia Gateway - Tourism of Cambodia Oct 25, 2010,11:32 #2 webber123456 View Profile View Forum Posts SitePoint Guru Join Date Jun 2007 Posts 691 Mentioned 0 Post(s) Tagged 0 Thread(s) you need to verify that "rs("RATING").Value" is not null and is in fact a numerical type. Oct 26, 2010,17:01 #3 pcboy View Profile View Forum Posts SitePoint Member Join Date May 2006 Location Phnom Penh, Cambodia Posts 19 Mentioned 0 Post(s) Tagged 0 Thread(s)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ASP Classic - Type mismatch: 'CInt' - Easy http://www.sitepoint.com/forums/showthread.php?709053-Microsoft-VBScript-runtime-error question up vote 1 down vote favorite Having an issue with type conversion in ASP classic. heres my code: Set trainingCost = Server.CreateObject("ADODB.Recordset") strSQL3 = "SELECT cost1 FROM tblMain WHERE (Booked = 'Booked') AND (Paid IS NULL) AND (PaidDate BETWEEN '01/04/" & startyear & "' AND '31/03/" & endyear & "')" trainingCost.Open strSQL3, Connection trainingCost.movefirst totalTrainCost = 0 do while not trainingCost.eof trainCost = trainingCost("cost1") If NOT isNull(trainCost) http://stackoverflow.com/questions/1287503/asp-classic-type-mismatch-cint-easy-question then trainCostStr = CStr(trainCost) trainCostStr = Replace(trainCostStr, "£", "") trainCostStr = Replace(trainCostStr, ",", "") totalTrainCost = totalTrainCost + CInt(trainCostStr) end if trainingCost.movenext loop trainingCost.close when I run this I get the following error: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'CInt' /systems/RFT/v1.2/Extract.asp, line 43 which is "totalTrainCost = totalTrainCost + CInt(trainCostStr)" Im guessing that the problem is to do with the String value being uncastable to Int in which case is there any way to catch this error? I havent worked with asp classic much so any help would be usefull cheers -EDIT- the type of column cost1 is String as it may contain a number or a sequence of chars eg £10.00 or TBC asp-classic share|improve this question edited Aug 17 '09 at 12:45 asked Aug 17 '09 at 11:39 Jambobond 2313918 What data type sore the Cost1 field have in tblMain? If its a string type, why is not a Currency type?? –AnthonyWJones Aug 17 '09 at 11:52 Ok so sorry i forgot to mention that the Cost1 column contains strings which can be null or £0.00 or 0.00 or 0 or TBC, so it can't be formatted as a string. –Jambobond Aug 17 '0
The runtime error 800A000D is straightforward to solve. The secret is to read the Windows Script Error message carefully, then locate the line number with the Type http://www.computerperformance.co.uk/Logon/code/code_800A000D.htm Mismatch. Introduction To Error Code 800A000D This runtime error, 800A000D occurs when you execute a VBScript. My suggestion is that there is a VBScript statement that does not understand a keyword you are using in your script. Alternatively, you may not be running the script as an ordinary user and not as an Administrator. The Symptoms You Get 800A000D The script does not execute microsoft vbscript as you hoped, instead you get a Microsoft VBScript runtime error. One possibility is that you are using a WSH object or method that has been misspelt.Chuck kindly wrote in saying that another cause maybe that you are logged on as ordinary user, and not an Administrator. The Cause of Code 800A000D Your VBScript contains an illegal method, probably due to a typing mistake, an microsoft vbscript runtime extra letter. Look for a clue opposite the phrase Error: Type mismatch.... In particular, double check the spelling of your objects.Note 1: Source: Microsoft VBScript runtime error. This is not a syntax error in the sense of a missing bracket, more a typo in the keyword mentioned in the Error: line of your WSH Message.Note 2: Error: Type mismatch: 'Join'. Chuck says this could mean that you are logged on as an ordinary user and not an administrator. Note 3: What I have found, is that there need not be any errors per se in the script in order to receive the type mismatch join error. But what the cause has been for two of my recent experiences, is that the user in question, is only a part of a single group that isn't 1. A domain built-in group. 2. Query based distribution groups. The join statement fails in this case because the CurrentUser.MemberOf only contains a single value so when it tries to append the next value, there is no array for it to search through. One fix would be to add error handling around this statement, so that