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

WHERE Game = '"& gamevar &"';

Options
  • 15-04-2004 9:30am
    #1
    Closed Accounts Posts: 1,441 ✭✭✭


    <%

    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 * 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>" & iRS.Fields("Review") & "</td>")
    Response.Write("<td>" & iRS.Fields("Picture") & "</td>")
    Response.Write("<td>" & iRS.Fields("Trailer") & "</td></tr>")

    iRS.MoveNext
    Loop


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

    %>

    ok here my asp/sql to retrieve the review trailer and picture from the list db which matches the variable retrieved from another page! the problem is it doesnt! It just doesnt retrieve any data, but if i remove the "WHERE Game = '"& gamevar &"';"
    it will!!! Any help???
    PM said it might be becauce the iRS might be been used on another page but i have removed all possibilities of that!! Any thoughts??


Comments

  • Registered Users Posts: 629 ✭✭✭str8_away


    It sounds like there is nothing in the DB that "WHERE Game = '"& gamevar &"';"
    Actully I don't see you assign gamevar to any string.

    Try to response.write "sQuery" in your code so you know what query string you are passing to DB. Then run the same line in DB. More likely it would not return anything either.

    Hope this helps


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


    "Select * from Links WHERE Game = '"& gamevar &"';

    this is probably your problem...

    what data type is the parameter gamevar?
    I assume its a string value?

    You say it comes from another page, the only thing i can think of is that its not getting passed properly, can u debug it line by line and check the value of gamevar?


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


    thanks lads but apparently it was just '"& Request("gamevar") &"'; ", works great now!


Advertisement