0

I have tried everything I can think of and to me, there's no reason for this not to work. However, ASP is not my native language and I need some insight. I have a variable that will be defined by a request from the URL. I want to then use that variable in a function call.

if pub_id <> "" then
    response.write(pub_id)
    response.write(pulldownQuery("newsletter_publication",pub_id,"live",newsletter_query))
  else
    response.write(pulldownQuery("newsletter_publication","","live",newsletter_query))
  end if

However, that does not work. What does work, though, is if I hard code an id into the value portion of the function call.

response.write(pulldownQuery("newsletter_publication",58,"live",newsletter_query))

When I print pub_id it returns 58 (or whatever the id happens to be). What am I missing here that is causing my variable to not work with this function call?

2 Answers 2

1

A solution I found was to explicitly define my pub_id variable as an integer, not a string.

pub_id = CInt(pub_id)

Once I defined it as such, everythig worked like a charm.

Sign up to request clarification or add additional context in comments.

1 Comment

I think if you post a portion of the pulldownQuery function (edit your question), it might help to explain why explicitly converting pub_id to integer fixes the issue. Then this question and answer can be more useful to future visitors.
0

Have you tried to see whether your variable pub_id has a value already? You can take a look at this ASP Querystring exercise. http://www.w3schools.com/asp/coll_querystring.asp

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.