Database Retrieval

Discussion in 'Classic ASP' started by _EarnIt_, May 17, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am trying to link to a database to recall a range of values. These values will be submitted by website users. The problem is some of the values are null (i.e., like the primary key) until a user inputs data.

    Here is a snipet of the code i am trying to use ...

    Dim cnnDB, strQuery30, rsInfo30

    strQuery30 = "SELECT Player_1, Player_2 FROM Round_1_Input_Test where Table_Number = 30"

    Set rsInfo30 = cnnDB.Execute(strQuery30)

    <font face="Lucida Bright" style="font-size: 10pt"><% =rsInfo30("Player_1") %>
    <% =rsInfo30("Player_2") %>

    <u>Game 2</u></font></b></p>


    I think the problem lies in the fact that in my database Table_Number = 30 (table number is the primary key of my database and is set to autonumber) does not exist until the database progresses that far. I know that there will be a discrete number of inputs (64 to be exact.). Also, I want to input these values into a predefined table on my web page. For Table_Numbers that are defined the web page works as it should. Is there some sort of If or select statement that I should/could be using to help me with this situation.

    Here is the web page link w/ the error on it.

    http://www.warwrights.org/Pages/Trouney_Pages/tournament_Bracket.asp

    Thank you
    EarnIt







    _EarnIt_
    (How else can you get any where in life)
     
  2. You are getting an EOF (End of File) BOF (Beginning of File) Error. That means there is not a record corresponding to the request. The classic way of handling this is to enclose the call in a conditional statement

    <%IF NOT rsInfo30.EOF Then%>

    <font face="Lucida Bright" style="font-size: 10pt"><% =rsInfo30("Player_1") %>
    <% =rsInfo30("Player_2") %>

    <u>Game 2</u></font></b></p>

    <%End IF%>

    That will insure that the HTML is served to the page only if a corresponding record is retrieved before the end of the file is reached.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page