I have an access database which I can display then contents of. What I have done is create a relationship with one of the fields and another table within that database. I manage the local football clubs web site and the problem I had a while back - which I resolved - was there were two variables id 1 - ("location") Away id 2 -("location") Home. In the actual database itself when viewed you could select and view home and away, however when using asp instead of reading the associated field it was reading the id number. This was resolved by using this:
<%If objRS("location")="1" Then
Response.Write("Away")
else
Response.Write("Home")
End If %>
Basically if it wasn't 1 it was the other.
I have now created a new table in relation to the team. There are seventeen players. I want to be able to select the players for each match played, however same problem instead of getting the player name - as displayed in the access database via the lookup function, I get the player id. Being 11 (starting - not including reserves) and not just two I can't use the above. I could use this...
<%
If objRS("player1")="1" Then
Response.Write("Jones")
End If
If objRS("player1")="2" Then
Response.Write("White")
End If
If objRS("player1")="3" Then
Response.Write("Cooper")
End If %>
Running up to total number of players we currently have, however there is sixteen sections and everytime a new player signs - we had forty last season, I'd have to manually add them to that asp page as well as adding them to the database. I am using table players with player_id and player_name. The page is rendering the player_id number, is there a more efficient way of converting that to the players name?
Thanks in advance...
Neil


Reply With Quote

Bookmarks