Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    6
    Member #
    15789
    Iím trying to format my output from a MS Access database. Iím using ASP to retrieve the results from the database and CSS to format the output.

    The results contain a thumbnail image that can be enlarged. I would like to alternate these results so that the image is on the right for result 1, left for result 2, right for 3 and so forth.

    Currently I have the images all floated to the right. This works fine, however itís not the desired result.

    A preview can been seen at http://www.bigchetti.com/camelot/larin.asp

    The formatting code is:

    <div class="maincontent">
    <%Set MyConn = Server.CreateObject("ADODB.Connection")
    MdbFilePath = Server.MapPath("Databases/camelot.mdb")
    MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
    SQL_query = "SELECT * FROM ProdCamelot WHERE ProdID >=0 AND ProdCategory = 'inflatable'"
    Set RS = MyConn.Execute(SQL_query)
    WHILE NOT RS.EOF
    %>

    <h3><%=RS("ProdNme")%></h3>
    <!-- <p><img class="floatright" src="ProdImage/<%=RS("ProdImge")%>" alt="" ></p> -->
    <a href="ProdImage/<%=RS("ProdImge")%>"><img border="0" src="ProdImage/<%=RS("ProdImge")%>" width="190" height="150" alt="" class="floatRight"></a>
    <p><%=RS("ProdDsc")%></p>
    <p>Price:<%response.write FormatCurrency(RS("ProdCost")) %></p>


    <%
    RS.MoveNext
    WEND
    %>


    </div>


    If anyone has any ideas your feedback would be appreciated.
    Thanks.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    If you wrap each element in a div, that should give you more control over display:
    Code:
    <div class="maincontent">
        <%
        Set MyConn = Server.CreateObject("ADODB.Connection")
        MdbFilePath = Server.MapPath("Databases/camelot.mdb")
        MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
        SQL_query = "SELECT * FROM ProdCamelot WHERE ProdID >=0 AND ProdCategory = 'inflatable'"
        Set RS = MyConn.Execute(SQL_query)
        WHILE NOT RS.EOF
        %>
    
        <div class="product">
            <h3><%=RS("ProdNme")%></h3>
            <!-- <p><img class="floatright" src="ProdImage/<%=RS("ProdImge")%>" alt="" ></p> -->
            <a href="ProdImage/<%=RS("ProdImge")%>"><img border="0" src="ProdImage/<%=RS("ProdImge")%>" width="190" height="150" alt="" class="floatRight"></a>
            <p><%=RS("ProdDsc")%></p>
            <p>Price:<%response.write FormatCurrency(RS("ProdCost")) %></p>
        </div>
    
        <%
            RS.MoveNext
        WEND
        %>
    </div>

  4. #3
    Junior Member
    Join Date
    Sep 2007
    Posts
    6
    Member #
    15789
    Quote Originally Posted by transio
    If you wrap each element in a div, that should give you more control over display:
    Code:
    <div class="maincontent">
        <%
        Set MyConn = Server.CreateObject("ADODB.Connection")
        MdbFilePath = Server.MapPath("Databases/camelot.mdb")
        MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
        SQL_query = "SELECT * FROM ProdCamelot WHERE ProdID >=0 AND ProdCategory = 'inflatable'"
        Set RS = MyConn.Execute(SQL_query)
        WHILE NOT RS.EOF
        %>
     
        <div class="product">
            <h3><%=RS("ProdNme")%></h3>
            <!-- <p><img class="floatright" src="ProdImage/<%=RS("ProdImge")%>" alt="" ></p> -->
            <a href="ProdImage/<%=RS("ProdImge")%>"><img border="0" src="ProdImage/<%=RS("ProdImge")%>" width="190" height="150" alt="" class="floatRight"></a>
            <p><%=RS("ProdDsc")%></p>
            <p>Price:<%response.write FormatCurrency(RS("ProdCost")) %></p>
        </div>
     
        <%
            RS.MoveNext
        WEND
        %>
    </div>

    Problem has been solved. No need to add more divs. The problem was in the ASP code. I needed to add some variables, a counter and an IF else statement.

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Quote Originally Posted by BigChetti
    Problem has been solved. No need to add more divs. The problem was in the ASP code. I needed to add some variables, a counter and an IF else statement.
    That doesn't discredit my post. Adding a div WILL give you more display options. ;-)

  6. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    6
    Member #
    15789
    Fair enough. Thanks for your help


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:20 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com