Results 1 to 3 of 3

Thread: [RESOLVED] RE: Expected statement but conding is right..

  1. #1

    Thread Starter
    Fanatic Member kaihirst's Avatar
    Join Date
    Jul 2005
    Location
    The Resaurant At the End of The Universe
    Posts
    633

    Resolved [RESOLVED] RE: Expected statement but conding is right..

    Hi,

    getting a expected statement error in select case function, but as it is a case statement, there is not need for any If statements. AHve inserted them to try (long shot) but to no avail. any bright ideas??

    ta

    kai


    function getLiveData()

    dim caseDetermine : caseDetermine = request.querystring("case")

    select case Cstr(caseDetermine)

    case "specific"

    strSQL = "SELECT keyword,store,address,date,product,hours FROM "&request.querystring("area")&" WHERE keyword = '"&request.querystring("keyword")&"';"
    objRS.open strSQL, objconn
    response.write strSQL 'debug command for SQL statement...
    if not objRS.eof or not objRS.bof then
    getLiveData = objRS.GetRows()

    case "nonspecific"

    strSQL = "SELECT keyword,store,address,date,product,hours FROM "&request.querystring("area")&";"
    response.write strSQL 'debug command for SQL statement...
    objRS.open strSQL, objconn
    if not objRS.eof or not objRS.bof then
    getLiveData = objRS.GetRows()

    case Else

    redim temp(1,1)
    temp(0,0) = -1
    getLiveData = temp

    end if
    end select
    end function
    As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..

    A few things that make a good Developer a Great One.
    Methodical and a thorough approach to research and design inevitably leads to success.
    Forward thinking is the key to Flow of control.
    Never test in the design environment, always test in real time, you get the REAL results.
    CBSE & OOSE are the same animal, they just require different techniques, and thinking.
    SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
    The key to good design is explicit attention to both detail and response.
    Think Freely out of the "Box" you're in..... You will soar to better heights.

    Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT


  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Expected statement but conding is right..

    I was getting that error when I accidently saved the file as rich text.... dunno if you made the same mistake but figured I would throw it out there.

  3. #3

    Thread Starter
    Fanatic Member kaihirst's Avatar
    Join Date
    Jul 2005
    Location
    The Resaurant At the End of The Universe
    Posts
    633

    Re: Expected statement but conding is right..

    Hi,

    Cheers anyways but I got it.

    The problem was that the expected statemewnt was coming because it was trying to execute an arbritrary command twice regardless of the case tests.

    in thsi case it was assigning the function value to getrows() sub twice regardless of the outcome of the test.

    tI have now put the function assignment outside of the select statement and it has worked, and speeded the response time fo the applicaiton , as no error handling needed now.

    ta

    kai

    P.S.

    If you ever want to run multiple sql statrements within a probram but done want to create the objects all over again, this is a handy way to do this using querystrings.

    ta

    kai (again)
    As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..

    A few things that make a good Developer a Great One.
    Methodical and a thorough approach to research and design inevitably leads to success.
    Forward thinking is the key to Flow of control.
    Never test in the design environment, always test in real time, you get the REAL results.
    CBSE & OOSE are the same animal, they just require different techniques, and thinking.
    SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
    The key to good design is explicit attention to both detail and response.
    Think Freely out of the "Box" you're in..... You will soar to better heights.

    Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width