ASP coding help needed

2 replies
hi

i have a mysql code
SELECT PartNum, Description, Price FROM Widgets WHERE CustID='ABC Video' AND Color='red'

How would you get the above info to be displayed in a web browser using ASP code?

i try to find the on the web but still could not find a good examnple.

any coders can help me out here by writing down the asp code on how to display?

justin
#asp #needed
  • Profile picture of the author rwil02
    Hi Justin. Time to help out someone I subscribe to for a change

    ASP 3.0 or ASP.NET (VB or C#)?

    I'll assume ASP 3.0, but easily modifiable.
    And watch the ", vs ' quotes. and no angle quotes please
    =============================
    dim rs
    set rs = CreateObject("ADODB.Recordset")
    rs.Open "SELECT PartNum, Description, Price FROM Widgets WHERE CustID='ABC Video' AND Color='red'", "CONNECTION STRING HERE"
    Response.Write "<table><tr><th>#</th><th>Desc</th><th>$</th></tr>"
    While not rs.EOF
    Response.Write "<tr>"
    Response.Write "<td>"
    Response.Write rs("PartNum")
    Response.Write "</td><td>"
    Response.Write rs("Description")
    Response.Write "</td><td>"
    Response.Write rs("Price")
    Response.Write "</td>"
    Response.Write "</tr>"
    rs.MoveNext
    Wend
    Response.Write "</table>"

    ====================

    All sorts of fancy formatting, etc you could do.
    In ASP.NET you would use a DataReader and a DateGrid or Repeater instead, so it's a bit different
    Signature

    Roger Willcocks
    L-Space Design
    Please vote to help me win a 3kW solar array

    {{ DiscussionBoard.errors[55305].message }}
    • Profile picture of the author Justin Koh
      thanks roger! didn't know you are a subscriber.
      I like your blog. it has been (a topic) something that i have been looking out for all along.
      {{ DiscussionBoard.errors[55321].message }}

Trending Topics