Sometime only one data can retrieved

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Sometime only one data can retrieved

    Hi,
    I developed web application with ASP, it was running well before we changed
    to use new server. After we started using new server since last year, we
    always have this problem that we only can retrieve one data from
    database(SQL Server 7).
    For example:
    The data is suppose to be showm as when I use "Select * from table1":
    AAA
    BBB
    CCC
    DDD
    EEE
    FFF

    However, the ASP page only shows AAA which alway is the first row of search
    result. If we click refresh button on Internet Explorer, most time all data
    will be shown.

    Does anyone know what the problem? Is it from ASP coding or Server setting
    or IIS or someting else?

    Thanks in advance,

    Wilton


    Wilton Yuan Guest

  2. Similar Questions and Discussions

    1. How to the get to number of retrieved columns?
      Hello everyone, i just implement an own search site in MS CRM 1.2, which searches in a MS-SQL database. My question is, how to get the number...
    2. How to get the number of retrieved columns when doing a SQL Query
      Hello everyone, i just implement an own search site in MS CRM 1.2, which searches in a MS-SQL database. My question is, how to get the number...
    3. Cookies not being retrieved from hard drive
      Hi, Using Training from the source book - Dreamweaver MX dynamic sites.......but software is actually Studio MX 2004, running on Windows 2000...
    4. How do I change data retrieved from db before sending it out to client
      I'm new to dotnet. This might not be the right place to post my question, if so, accept my apoligies and please redirect me to the correct group. ...
    5. nothing retrieved from ntext data type?
      Possibly this? http://support.microsoft.com/?kbid=200124 If not that, what code? Ray at work "s" <anonymous@discussions.microsoft.com>...
  3. #2

    Default Re: Sometime only one data can retrieved

    Please show us your code to retrieve the data


    John Guest

  4. #3

    Default Re: Sometime only one data can retrieved

    Hi John,

    Here is the sample coding.


    <%
    On Error Resume Next


    'Connect the Database
    Set Conn=Server.CreateObject("ADODB.Connection")
    Conn.Open "DSN=NorthwindDSN;UID=sa;PWD=;database=northwi nd"

    'SQL Command
    SQL="Select CategoryName, CategoryID from Categories "
    'run SQL Command
    Set RS=Conn.Execute(SQL)

    'Appear result

    Response.write "<table Align=center border=1 cellpadding=0 cellspacing=0
    width=700>"
    Response.write "<tr >"
    Response.write "<td colspan=2><B>" & Ucase(rs(0).Name) & "</B></td>"
    Response.write "<td colspan=2><B>" & Ucase(rs(1).Name) & "</B></td>"

    Response.write "</tr>"


    While Not rs.EOF
    Response.write "<tr>"

    Response.write "<td colspan=2><b>" & rs(0).Value &"</B></td>"
    Response.write "<td colspan=2><b>" & rs(1).Value &"</B></td>"
    rs.MoveNext
    Response.write "</tr>"
    Wend
    Response.write "</table>"


    Set Conn = nothing
    %>

    The result is supposed to be:
    Beverages 1
    Condiments 2
    Confections 3
    Dairy Products 4
    Grains/Cereals 5
    Meat/Poultry 6
    Produce 7
    Seafood 8

    However, sometime it only shows:

    Beverages 1

    After I click refresh button, sometime it will show all result, but sometime
    it still show the first record. It seems Rs.Movenext does not work.

    Thanks,

    WIlton Yuan



    Wilton Yuan Guest

  5. #4

    Default Re: Sometime only one data can retrieved

    One idea is to stop using a DSN and make sure MDAC is up to date.
    [url]http://www.aspfaq.com/2126[/url]

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "Wilton Yuan" <wdyuan@telus.net> wrote in message
    news:e7AW9g0cEHA.2520@TK2MSFTNGP12.phx.gbl...
    > Hi John,
    >
    > Here is the sample coding.
    >
    >
    > <%
    > On Error Resume Next
    >
    >
    > 'Connect the Database
    > Set Conn=Server.CreateObject("ADODB.Connection")
    > Conn.Open "DSN=NorthwindDSN;UID=sa;PWD=;database=northwi nd"
    >
    > 'SQL Command
    > SQL="Select CategoryName, CategoryID from Categories "
    > 'run SQL Command
    > Set RS=Conn.Execute(SQL)
    >
    > 'Appear result
    >
    > Response.write "<table Align=center border=1 cellpadding=0 cellspacing=0
    > width=700>"
    > Response.write "<tr >"
    > Response.write "<td colspan=2><B>" & Ucase(rs(0).Name) & "</B></td>"
    > Response.write "<td colspan=2><B>" & Ucase(rs(1).Name) & "</B></td>"
    >
    > Response.write "</tr>"
    >
    >
    > While Not rs.EOF
    > Response.write "<tr>"
    >
    > Response.write "<td colspan=2><b>" & rs(0).Value &"</B></td>"
    > Response.write "<td colspan=2><b>" & rs(1).Value &"</B></td>"
    > rs.MoveNext
    > Response.write "</tr>"
    > Wend
    > Response.write "</table>"
    >
    >
    > Set Conn = nothing
    > %>
    >
    > The result is supposed to be:
    > Beverages 1
    > Condiments 2
    > Confections 3
    > Dairy Products 4
    > Grains/Cereals 5
    > Meat/Poultry 6
    > Produce 7
    > Seafood 8
    >
    > However, sometime it only shows:
    >
    > Beverages 1
    >
    > After I click refresh button, sometime it will show all result, but
    sometime
    > it still show the first record. It seems Rs.Movenext does not work.
    >
    > Thanks,
    >
    > WIlton Yuan
    >
    >
    >

    Aaron [SQL Server MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139