Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Type Mismatch - QueryString

Posted on 2006-06-29
7
Medium Priority
?
289 Views
Last Modified: 2012-06-27
Hi,

Am am getting an error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: ""]'
/admin/includes/pages/retail/orders/view_order.asp, line 23

This type mismatch is on:

<%
Confirmation = killC(Request.QueryString("Confirmation"))
IF Confirmation = 1 THEN %> <-----------------------**************LINE 23******
      <p class="Confirm"><img src="/admin/images/ico_ok.gif">&nbsp;Order number <%=intOrderID%> has been re-opened.</p>
<% END IF %>
<% IF Confirmation = 2 THEN %>
      <p class="Confirm"><img src="/admin/images/ico_ok.gif">&nbsp;Order number <%=intOrderID%> has been cancelled.</p>
<% END IF %>

The confirmation variable is put through the function:

<%
Function killC(strWords)
     badChars = array("'","&rsquo;","&lsquo;","@","%")
     newChars = strWords
     for i = 0 to uBound(badChars)
          if ISNULL(newChars) then
          else
               newChars = replace(newChars, badChars(i), "`")
          end if
     next
     if ISNULL(newChars) then
     else
          'newChars = replace(replace(replace(newChars,vbcrlf,"<br />"),vbcr,"<br />"),vblf,"<br />")
     end if
     killC = newChars
     'Bad Word Array

End Function
%>

Doe anyone have any idea why this would be displaying type mismatch?

Regards,
Carl
0
Comment
Question by:net-workx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 

Author Comment

by:net-workx
ID: 17011649
A further note:

If i put <% ON ERROR RESUME NEXT %> then the page runs and displays but the two confirm messages display on the screen when there is no confirmation querystring.

Cheers,
Carl
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 17011677
Try

IF Confirmation = "1" THEN
0
 

Author Comment

by:net-workx
ID: 17011734
that works, so its converted it into a text value, how would i go about converting back to a numerical value?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 23

Expert Comment

by:Saqib Khan
ID: 17011752
Well your Function Accepts a Parameter, and that parameter is a String.
 Does your Function will Always Return a Numerical Value?
0
 
LVL 23

Accepted Solution

by:
Saqib Khan earned 2000 total points
ID: 17011780
if Confirmation is always suppose to be a INT. then...
Confirmation = killC(cINT(Request.QueryString("Confirmation")))

then you can compare as a Integer.
0
 

Author Comment

by:net-workx
ID: 17011828
no, the fuction can sometimes pull a character in other pages but in this scenario it will always be numerical but if i use Confirmation = killC(cINT(Request.QueryString("Confirmation"))) whenever i know for sure it will will be a numerical that will convert it back?



0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 17011845
Function cInt "always" Expects and Integer. if your confirmation variable will be either INT or String randomly then you have no choice but to use this variable as a String/Variant and compare using string value instead of INT.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question