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

WHERE Game = '"& gamevar &"';

  • 15-04-2004 8: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, Registered Users 2 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