We help IT Professionals succeed at work.

Defining a Number v Text

Graeme
Graeme asked
on
103 Views
Last Modified: 2017-04-09
Hello all and thanks in advance for your assistance

I am having issues with what I thought was how to tell the difference between a number and text by using IsNumeric, however I am finding that for example
If IsNumeric(Request.QueryString("all") Then

Open in new window

is processing and giving an output...

Is there something I am missing?
Comment
Watch Question

If IsNumeric(Request.QueryString("all") ) Then

Open in new window


Miss )
GraemeGPTouring

Author

Commented:
Sorry Manuel, yes I did miss it in this Question... however it is in the code.. sorry again
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
GraemeGPTouring

Author

Commented:
Thanks for that Manuel

The issue im getting is...

x="all"
response.write(IsNumeric(x))

If IsNumeric(x) Then

This is coming true and then proceeding in the IF statement
GraemeGPTouring

Author

Commented:
The actual Code that is having an issue is:

Request.QueryString("event")="all"

If IsNumeric(Request.QueryString("event")) Then

Open in new window

CERTIFIED EXPERT

Commented:
x="all"
response.write(IsNumeric(x))
this returned as false to me.
GraemeGPTouring

Author

Commented:
Hi Ryan, in post 42071145, I am displaying the code that is having an issue... :(

I have just thought of something... Its showing up on a page that doesnt require is... eg http://dev.gptouring.com.au/?
CERTIFIED EXPERT

Commented:
Request.QueryString("event")="all"
this should be an invalid statement and your page would have generated an error on screen.
CERTIFIED EXPERT

Commented:
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'event_code=code_short AND event_start>Now() AND code_live=TRUE AND event_live=TRUE AND event_ID='. 

Open in new window


as what i guess... from this error, it mentioned that Request.QueryString("event") is missing which causing error in your SQL statement.

so you need to have a better error handling in case Request.QueryString("event") is not found.
GraemeGPTouring

Author

Commented:
I think I have figured it out...

If IsNumeric(Request.QueryString("event")) AND NOT (Request.QueryString="" OR Request.QueryString="?") Then

Open in new window


doesnt error... is that because it would see "" OR "?" as IsNumeric?
CERTIFIED EXPERT

Commented:
If IsNumeric(Request.QueryString("event")) AND NOT (Request.QueryString="" OR Request.QueryString="?") Then
nope... what if you have this?

http://dev.gptouring.com.au/?x
http://dev.gptouring.com.au/?bla=

Open in new window

etc?
GraemeGPTouring

Author

Commented:
I am getting errors on:
http://dev.gptouring.com.au/?category=70
Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'event_code=code_short AND event_start>Now() AND code_live=TRUE AND event_live=TRUE AND event_ID='.

Open in new window


Why would this happen?

Im not even asking for Request.QueryString("event") on this page...
CERTIFIED EXPERT

Commented:
Im not even asking for Request.QueryString("event") on this page... 

Open in new window

try post and examine the codes around:

AND event_ID=

Open in new window


and you should fine that something is missing there
GPTouring
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
GraemeGPTouring

Author

Commented:
Yeah I a not sure why...

The homepage of the website is first in the hierarchy order and the Query that it is erroring on (the line we have seen
'event=') is after it.

just strange!

seems to be not erroring now, been through alot of pages and all good
GraemeGPTouring

Author

Commented:
Strange that it is doing this, but work around works

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions