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

asp

Options
  • 24-03-2004 12:39pm
    #1
    Closed Accounts Posts: 1,441 ✭✭✭


    ok project for the year bla bla
    try to pick from access table using a variable called gamevar!!
    basicly you click the link, it selects the review of the game compared to the name!
    wont select using the variable??? any help please!!


    oConn.provider="Microsoft.Jet.OLEDB.4.0"
    oConn.Open (server.MapPath("/csm3/csm33020/Project/list.mdb"))

    Set oRS = server.createobject("ADODB.Recordset")
    sQuery= "Select Review, Picture, Trailer from Links WHERE = '& gamevar &'"
    set oRS = oConn.Execute(sQuery)


Comments

  • Moderators, Society & Culture Moderators Posts: 2,688 Mod ✭✭✭✭Morpheus


    what language are you using? whats the development environment?

    you cant just fire up a question and some code and expect an answer!!!

    give us some info. :confused:


  • Closed Accounts Posts: 1,441 ✭✭✭The_Goose


    my aploigises!
    ASP sql, access databases, development enviroment??


    Right would you go about using the codes above to select data from an access database using a variable


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


    well this is wrong
    sQuery= "Select Review, Picture, Trailer from Links WHERE = '& gamevar &'"
    should be

    sQuery= "Select Review, Picture, Trailer from Links WHERE = '"& gamevar &"'"
    note the gamevar is outside the "" so if gamevar is Quake then the query string ends up as
    Select Review, Picture, Trailer from Links WHERE 'Quake'

    but you still have a problem
    you need have colum in the where clause that will match with 'Quake'
    maybe
    Select Review, Picture, Trailer from Links WHERE GameName = 'Quake'
    so the query string becomes

    sQuery= "Select Review, Picture, Trailer from Links WHERE GameName= '"& gamevar &"'"


  • Closed Accounts Posts: 1,441 ✭✭✭The_Goose


    Originally posted by amen

    sQuery= "Select Review, Picture, Trailer from Links WHERE GameName= '"& gamevar &"'"

    Thanks a bunch seems to work, just doesnt retrieve any data!!
    in the table there s Game, Link, Review , picture and trailer

    sQuery= "Select Review, Picture, Trailer from Links WHERE Game = '"& gamevar &"'"
    but it doesn't produce anything

    ????????????????/??????????/???????/Project/reviewfind.asp?gamevar=BusterBomber

    So it should selct any info in the review pic and trailer columns on a game buster bomber!!



    <%

    Dim oConn
    Dim iRS


    Set oConn = Server.CreateObject("ADODB.Connection")

    oConn.provider="Microsoft.Jet.OLEDB.4.0"
    oConn.Open (server.MapPath("/csm3/csm33020/Project/list.mdb"))

    Set iRS = server.createobject("ADODB.Recordset")
    sQuery= "Select Review, Picture, Trailer from Links WHERE Game = '"& gamevar &"'"
    set iRS = oConn.Execute(sQuery)

    Response.Write("<table border=0 cellpadding=1 cellspacing=1 style='font-family:arial; font-size:10pt;'>")
    Response.Write("<tr bgcolor=black style='color:white;'><td>Review</td>")
    Response.Write("<td>Picture</td>")
    Response.Write("<td>Trailer</td></tr>")

    Do While NOT iRS.EOF
    Response.Write("<tr bgcolor='" & sColor & "'>")
    Response.Write("<td>" & oRS("Review") & "</td>")
    Response.Write("<td>" & oRS("Picture") & "</td>")
    Response.Write("<td>" & oRS("Trailer") & "</td></tr>")

    iRS.MoveNext
    Loop


    Response.Write("</table><br><br>")
    oConn.Close
    Set iRS = Nothing
    Set oConn = Nothing

    %>


Advertisement