Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP Programming Assistant

  • 16-05-2006 6:22am
    #1
    Closed Accounts Posts: 12


    Anybody can help me regarding in ASP programming? I am new in handling this kind of programming language it happen that I handle an existing site which created in ASP programming and it happen that an error exist, is it possible that any error exist in the long term run of the site because before there is no error when you browse the site?

    To be more specific one of the site doesn't sort alphabetically but before it run with no problem. This is the site to be particular http://www.newshan.com/accommodation_hotels.asp. I hope somebody can help me with this problem.


    Thanks,
    Deks_x


Comments

  • Registered Users, Registered Users 2 Posts: 1,466 ✭✭✭Smoggy


    I dont get fully get what your looking for , its sounds like a sql ordering issue, but the site doesnt load so I cant have a look.

    The sql should look something like this :

    select * from accomadation
    Order by x asc

    Using the following for the reverse :

    select * from accomadation
    Order by x desc

    x being the field your looking to sort on


  • Registered Users, Registered Users 2 Posts: 441 ✭✭robfitz


    Just a few quick tips:

    * Make sure you have a copy of the site/code running on your local machine.
    * Get a copy Visual Studio installed on your local machine and enable server side debugging on your local machine. http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/WINDOWS2000/en/server/iis/htm/core/iiwarndd.htm
    * You can now put 'Stop' in your code to start the debugger, you should then be able to step through the code. If you get other errors they will also triger the debugger.
    * Every asp file should include 'Option Explicit', though you can't put it in files which are included in other files.
    * Don't declare all your variables at the start of the asp file, declare local variables in each function/sub and pass in parameters.


  • Closed Accounts Posts: 12 deks_x


    Thanks a lot for your help. It happen that one of the site must put hotel name in Alphabetical order for client easy reference to view. Before it work properly it display in Alphabetical order but now it won't display alphabetically (For your reference please click here). Do you think the cause of that is our database because we used only microsoft access in database handling, right now the size of data is quite big and aside from that many people are accessing our database from time to time.


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    MS Access has nothing to do with the sort order but will run into other issues with concurrency and db size with access.
    Can you post the query/sql you use to select the data and some sample data that is incorrect and what you think the correct data should look like?


  • Closed Accounts Posts: 12 deks_x


    This is the source code:

    //init datas
    countrys = new Array();
    citys = new Array();
    <%
    Set rsNavCountry = objConn.Execute("select DISTINCT a.COUNTRY_CODE, b.COUNTRY_DESC from TB_ACCOM_RATES a, CODE_COUNTRY b where a.COUNTRY_CODE = b.COUNTRY_CODE and a.ACTIVE='Y' and a.ACCOM_TYPE='HTL' and a.VALIDITY_END_DATE > NOW() order by b.COUNTRY_DESC")
    ccIndex = 0
    do while not rsNavCountry.EOF
    dbNav_CountryCode = rsNavCountry("COUNTRY_CODE")
    dbNav_CountryDesc = rsNavCountry("COUNTRY_DESC")
    %>
    countrys[<%=ccIndex%>] = new Option("<%=dbNav_CountryDesc%>","<%=dbNav_CountryCode%>");
    citys[<%=ccIndex%>] = new Array();
    <%
    Set rsSearchCity = objConn.Execute("select DISTINCT a.CITY_CODE, b.CITY_DESC from TB_ACCOM_RATES a, CODE_CITY b where a.CITY_CODE = b.CITY_CODE and a.COUNTRY_CODE='"&dbNav_CountryCode&"' and a.ACCOM_TYPE='HTL' and a.VALIDITY_END_DATE > NOW() order by b.CITY_DESC")
    ciIndex = 0
    do while not rsSearchCity.EOF
    dbSearch_CityCode = rsSearchCity("CITY_CODE")
    dbSearch_CityDesc = rsSearchCity("CITY_DESC")
    %>
    citys[<%=ccIndex%>][<%=ciIndex%>]=new Option("<%=dbSearch_CityDesc%>","<%=dbSearch_CityCode%>");
    <%
    ciIndex = ciIndex + 1
    rsSearchCity.movenext
    loop
    ccIndex = ccIndex + 1
    rsNavCountry.movenext
    loop
    %>
    //
    var country_handle = document.frmHotelSearch.loadCountry
    var city_handle=document.frmHotelSearch.loadCity

    function show_country(select_handle)
    {
    for(i=0;i<countrys.length;i++)
    {
    select_handle.options = new Option(countrys.text, countrys.value);
    }
    select_handle.options[0].selected = true;
    }

    function show_default_city()
    {
    for(i=0;i<citys[0].length;i++)
    {
    city_handle.options = new Option(citys[0].text, citys[0].value);
    }
    city_handle.options[0].selected = true;

    }

    function redirect(x){
    for (m=city_handle.options.length-1;m>0;m--)
    {
    city_handle.options[m]=null
    }
    for (i=0;i<citys[x].length;i++)
    {
    city_handle.options=new Option(citys[x].text,citys[x].value)
    }
    city_handle.options[0].selected=true;
    }

    show_country(country_handle);
    show_default_city();

    var nav_country_handle = document.navigation.selNav
    show_country(nav_country_handle);


    Please check this site for the output: http://www.newshan.com/accommodation_hotels.asp


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    on the link you gave countries/cities are sorted
    If I click on a city to get a list of hotels the hotesl are sorted by PRICE
    so whats is the exact problem?


  • Closed Accounts Posts: 12 deks_x


    Thanks for your help. I want to sort the name of hotels in alphabetical order can you help me to solve that problem? Before the site work properly it sort in alphabetical order but now suddenly it not work in order.


  • Registered Users, Registered Users 2 Posts: 1,466 ✭✭✭Smoggy


    The above code looks be the search criteria , not the actual search and display of the hotels.


  • Closed Accounts Posts: 12 deks_x


    Before that program is working properly but right now it create a problem it is not sorting alphabetically what do you think the problem of the site? please click here


  • Registered Users, Registered Users 2 Posts: 1,466 ✭✭✭Smoggy


    Programs as a general rule , just dont break , someone must have changed the code.

    also is the above code from : accommodation_hotels_list.asp ?


  • Advertisement
Advertisement