Solved

Type Mismatch - QueryString

Posted on 2006-06-29
7
282 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
  • 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:adilkhan
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 23

Expert Comment

by:adilkhan
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:
adilkhan earned 500 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:adilkhan
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 Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now