Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2006, 07:19 PM
Authorized User
 
Join Date: Jun 2006
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
Default Disappearing Column Data

I have what appears to be very strange problem (and the fact that I'm an ASP newbie probably has something to do with it :-) ). My ASP is pulling query data just fine, except when I try and display too many columns. If I keep the number of columns to 4, then then I get data. If I add a fifth column, then it doesn't show (even though it might have shown in 4-columns). Here's my code:

<%
    Option Explicit
    Dim l_name
    Dim prob
    Dim rsCustSurvey
    Dim raction_summary
    Dim Conn
    l_name = Request.QueryString("l_name")
    prob = Request.QueryString("prob")
' response.write(l_name)

    set Conn=Server.CreateObject("ADODB.Connection")
    set rsCustSurvey = server.CreateObject("ADODB.Recordset")
    set raction_summary =server.CreateObject("ADODB.Recordset")


    Conn.open "Driver={SQL Server}; Server=serverL01;Database=ARSystem;UID=u;p;"

    set rsCustSurvey = conn.Execute ("Select ProblemDescriptionTrunc, Action_Summary, ProblemItem, Problem_Solution002, " _
        & " Problem_Description002, RootCause, LastModifiedBy, dbo.TTS_Main.AssignedGroup, dbo.TTS_Main.Last_Name, dbo.TTS_Main.First_Name, " _
        & " dbo.TTS_Main.Tracker, dbo.TTS_Main.Status, dbo.TTS_Main.AssignedGroup, AssignedTechnician, ModificationHistory "_
        & " From tts_main " _
    & " Where ProblemDescriptionTrunc LIKE '%" & prob & "%' " _
    & " And Last_Name LIKE '%" & l_name & "%' ")

    if rsCustSurvey.EOF then 'traps for IF recordset is empty THEN:
        Response.Write "There is no data"
        Response.End
    end if

%>

<table border="1">

    <tr>
        <td align="center"><b>Problem Description</td>
        <td align="center"><b>Action Summary</td>
        <td align="center"><b>Root Cause</td>
        <td align="center"><b>Last Name</td>
        <td align="center"><b>Problem Solution</td>

    </tr>


        <%do while not rsCustSurvey.EOF%></do>
    <tr>


        <td>
            <%response.write rsCustSurvey("ProblemDescriptionTrunc")%>
        </td>


        <td>
            <%response.write rsCustSurvey("Problem_Solution002")%>
        </td>

        <td>
            <%response.write rsCustSurvey("RootCause")%>
        </td>

        <td>
            <%response.write rsCustSurvey("Last_Name")%>
        </td>

        <td>
            <%response.write rsCustSurvey("Action_Summary")%>
        </td>





    </tr>
        <%rsCustSurvey.MoveNext%>
        <%loop%>



</table>


<%
    set rsCustSurvey = nothing
    set conn = nothing
%>



See anything out of whack?

thanks!

Dale

 
Old November 21st, 2006, 09:42 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you sure that the Action_Summary column of the database does contain data?

You have an unwanted </do> in the code.

Could you try:


<%
    Option Explicit

    Dim l_name
    Dim prob
    Dim rsCustSurvey
    Dim raction_summary
    Dim Conn

    l_name = Request.QueryString("l_name")

    prob = Request.QueryString("prob")

    Set Conn=Server.CreateObject("ADODB.Connection")
    Set rsCustSurvey = server.CreateObject("ADODB.Recordset")
    Set raction_summary = server.CreateObject("ADODB.Recordset")

    Conn.open "Driver={SQL Server}; Server=serverL01;Database=ARSystem;UID=u;p;"

    set rsCustSurvey = conn.Execute ("Select ProblemDescriptionTrunc, Action_Summary, ProblemItem, Problem_Solution002, " _
        & " Problem_Description002, RootCause, LastModifiedBy, dbo.TTS_Main.AssignedGroup, dbo.TTS_Main.Last_Name, dbo.TTS_Main.First_Name, " _
        & " dbo.TTS_Main.Tracker, dbo.TTS_Main.Status, dbo.TTS_Main.AssignedGroup, AssignedTechnician, ModificationHistory "_
        & " From tts_main " _
    & " Where ProblemDescriptionTrunc LIKE '%" & prob & "%' " _
    & " And Last_Name LIKE '%" & l_name & "%' ")

    if rsCustSurvey.EOF then 'traps for IF recordset is empty THEN:
        Response.Write "There is no data"
        Response.End
    else
    %>
        <table border="1">
            <tr>
                <td align="center"><b>Problem Description</td>
                <td align="center"><b>Action Summary</td>
                <td align="center"><b>Root Cause</td>
                <td align="center"><b>Last Name</td>
                <td align="center"><b>Problem Solution</td>
            </tr>
        <%
            while not rsCustSurvey.EOF

                response.write "<tr>"
                response.write "<td>1" & rsCustSurvey("ProblemDescriptionTrunc") & "</td>"
                response.write "<td>2" & rsCustSurvey("Problem_Solution002") & "</td>"
                response.write "<td>3" & rsCustSurvey("RootCause") & "</td>"
                response.write "<td>4" & rsCustSurvey("Last_Name") & "</td>"
                response.write "<td>5" & rsCustSurvey("Action_Summary") & "</td>"
                response.write "</tr>"

                rsCustSurvey.MoveNext

            wend
        %>
        </table>
    <%
    end if
    set rsCustSurvey = nothing
    set conn = nothing
    %>






Regards,

Sean Anderson





Similar Threads
Thread Thread Starter Forum Replies Last Post
disappearing spaces gezi XSLT 0 March 26th, 2006 02:23 AM
Disappearing wizards BlacKnight Access 3 January 19th, 2005 04:35 PM
disappearing cookie droth BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 October 28th, 2004 09:24 AM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.