GetRows Mystery

Discussion in 'ASP General' started by Moshe, Aug 28, 2003.

  1. Moshe

    Moshe Guest

    I'm facing an odd behavior in using the GetRows Method. I'm not sure what's
    causing it because it has been working fine until now.

    I have a sproc that returns 1 row. I display the RS info on the page using a
    DO-WHILE loop. All fields have values.

    I then rerun the same sproc, but this time extract the values into an array
    using getrows. I loop through the array and display the content of each
    element on screen. However, from the 14 fields, fields 0, 1, 12, 13, & 14
    have data and all else are empty.

    This is all done in a simple test script, nothing fancy.

    I checked carefully that i didn't mix index or anything else silly and well
    as have someone else look at it.

    I know this is a longshot, but has anyone seen this behavior before? Maybe
    some component installed is causing this problem. Just thought I'll ask.

    Thanks for any info.
     
    Moshe, Aug 28, 2003
    #1
    1. Advertising

  2. Moshe

    Ray at Guest

    What kind of database? What types of data are those columns? Access/memo?

    Ray at work

    "Moshe" <> wrote in message
    news:...
    > I'm facing an odd behavior in using the GetRows Method. I'm not sure

    what's
    > causing it because it has been working fine until now.
    >
    > I have a sproc that returns 1 row. I display the RS info on the page using

    a
    > DO-WHILE loop. All fields have values.
    >
    > I then rerun the same sproc, but this time extract the values into an

    array
    > using getrows. I loop through the array and display the content of each
    > element on screen. However, from the 14 fields, fields 0, 1, 12, 13, & 14
    > have data and all else are empty.
    >
    > This is all done in a simple test script, nothing fancy.
    >
    > I checked carefully that i didn't mix index or anything else silly and

    well
    > as have someone else look at it.
    >
    > I know this is a longshot, but has anyone seen this behavior before? Maybe
    > some component installed is causing this problem. Just thought I'll ask.
    >
    > Thanks for any info.
    >
    >
     
    Ray at, Aug 28, 2003
    #2
    1. Advertising

  3. Moshe

    Moshe Guest

    SQLServer 2000
    MDAC 2.7

    Fields are varchar or integer.


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > What kind of database? What types of data are those columns?

    Access/memo?
    >
    > Ray at work
    >
    > "Moshe" <> wrote in message
    > news:...
    > > I'm facing an odd behavior in using the GetRows Method. I'm not sure

    > what's
    > > causing it because it has been working fine until now.
    > >
    > > I have a sproc that returns 1 row. I display the RS info on the page

    using
    > a
    > > DO-WHILE loop. All fields have values.
    > >
    > > I then rerun the same sproc, but this time extract the values into an

    > array
    > > using getrows. I loop through the array and display the content of each
    > > element on screen. However, from the 14 fields, fields 0, 1, 12, 13, &

    14
    > > have data and all else are empty.
    > >
    > > This is all done in a simple test script, nothing fancy.
    > >
    > > I checked carefully that i didn't mix index or anything else silly and

    > well
    > > as have someone else look at it.
    > >
    > > I know this is a longshot, but has anyone seen this behavior before?

    Maybe
    > > some component installed is causing this problem. Just thought I'll ask.
    > >
    > > Thanks for any info.
    > >
    > >

    >
    >
     
    Moshe, Aug 28, 2003
    #3
  4. Moshe

    Ray at Guest

    Post relevant code snippet then please.

    Ray at work

    "Moshe" <> wrote in message
    news:%...
    > SQLServer 2000
    > MDAC 2.7
    >
    > Fields are varchar or integer.
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:...
    > > What kind of database? What types of data are those columns?

    > Access/memo?
    > >
    > > Ray at work
    > >
    > > "Moshe" <> wrote in message
    > > news:...
    > > > I'm facing an odd behavior in using the GetRows Method. I'm not sure

    > > what's
    > > > causing it because it has been working fine until now.
    > > >
    > > > I have a sproc that returns 1 row. I display the RS info on the page

    > using
    > > a
    > > > DO-WHILE loop. All fields have values.
    > > >
    > > > I then rerun the same sproc, but this time extract the values into an

    > > array
    > > > using getrows. I loop through the array and display the content of

    each
    > > > element on screen. However, from the 14 fields, fields 0, 1, 12, 13, &

    > 14
    > > > have data and all else are empty.
    > > >
    > > > This is all done in a simple test script, nothing fancy.
    > > >
    > > > I checked carefully that i didn't mix index or anything else silly and

    > > well
    > > > as have someone else look at it.
    > > >
    > > > I know this is a longshot, but has anyone seen this behavior before?

    > Maybe
    > > > some component installed is causing this problem. Just thought I'll

    ask.
    > > >
    > > > Thanks for any info.
    > > >
    > > >

    > >
    > >

    >
    >
     
    Ray at, Aug 28, 2003
    #4
  5. Moshe

    Moshe Guest

    IN the code below, i try it using the array, then try it using the recorset.
    In all, 14 fields are returned.

    set rs = cn.execute("spGetInfo 10, 20")

    '-- use this portion to display info via Recordset
    if not rs.eof then
    for i = 0 to 14
    response.write i & ": " & rs(i) & "<br>"
    next
    end if

    '-- use this portion to display info via Array
    'if not rs.eof then
    ' ar = rs.getrows
    ' for i = 0 to ubound(ar,1)
    ' response.write i & ": " & ar(i,0) & "<br>"
    ' next
    'end if

    rs.close
    set rs = nothing
     
    Moshe, Aug 28, 2003
    #5
  6. Moshe

    Moshe Guest

    I use the getrows approach or the recordset method, not both at the same
    time. I keep one of them commented.

    "Mike Florio" <> wrote in message
    news:...
    > Are you doing a movefirst() or requerying the database before looping thru
    > the records again ?
    >
    > "Moshe" <> wrote in message
    > news:...
    > > I'm facing an odd behavior in using the GetRows Method. I'm not sure

    > what's
    > > causing it because it has been working fine until now.
    > >
    > > I have a sproc that returns 1 row. I display the RS info on the page

    using
    > a
    > > DO-WHILE loop. All fields have values.
    > >
    > > I then rerun the same sproc, but this time extract the values into an

    > array
    > > using getrows. I loop through the array and display the content of each
    > > element on screen. However, from the 14 fields, fields 0, 1, 12, 13, &

    14
    > > have data and all else are empty.
    > >
    > > This is all done in a simple test script, nothing fancy.
    > >
    > > I checked carefully that i didn't mix index or anything else silly and

    > well
    > > as have someone else look at it.
    > >
    > > I know this is a longshot, but has anyone seen this behavior before?

    Maybe
    > > some component installed is causing this problem. Just thought I'll ask.
    > >
    > > Thanks for any info.
    > >
    > >

    >
    >
     
    Moshe, Aug 28, 2003
    #6
  7. Moshe

    Ray at Guest

    This code, after uncommenting it, works as expected for me. ? It's not an
    html issue is it, where your results actually are coming back but they're
    not displayed because of a missing quote or something, is it? View source?
    Just grasping at straws.

    Ray at work

    "Moshe" <> wrote in message
    news:...
    >
    > IN the code below, i try it using the array, then try it using the

    recorset.
    > In all, 14 fields are returned.
    >
    > set rs = cn.execute("spGetInfo 10, 20")
    >
    > '-- use this portion to display info via Recordset
    > if not rs.eof then
    > for i = 0 to 14
    > response.write i & ": " & rs(i) & "<br>"
    > next
    > end if
    >
    > '-- use this portion to display info via Array
    > 'if not rs.eof then
    > ' ar = rs.getrows
    > ' for i = 0 to ubound(ar,1)
    > ' response.write i & ": " & ar(i,0) & "<br>"
    > ' next
    > 'end if
    >
    > rs.close
    > set rs = nothing
    >
    >
     
    Ray at, Aug 28, 2003
    #7
  8. Moshe

    Moshe Guest

    No, it's not an html issue or something simple. I think it may have to do
    with configuration or some other component on the server. I just thought
    someone may have run across this.



    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > This code, after uncommenting it, works as expected for me. ? It's not

    an
    > html issue is it, where your results actually are coming back but they're
    > not displayed because of a missing quote or something, is it? View

    source?
    > Just grasping at straws.
    >
    > Ray at work
    >
    > "Moshe" <> wrote in message
    > news:...
    > >
    > > IN the code below, i try it using the array, then try it using the

    > recorset.
    > > In all, 14 fields are returned.
    > >
    > > set rs = cn.execute("spGetInfo 10, 20")
    > >
    > > '-- use this portion to display info via Recordset
    > > if not rs.eof then
    > > for i = 0 to 14
    > > response.write i & ": " & rs(i) & "<br>"
    > > next
    > > end if
    > >
    > > '-- use this portion to display info via Array
    > > 'if not rs.eof then
    > > ' ar = rs.getrows
    > > ' for i = 0 to ubound(ar,1)
    > > ' response.write i & ": " & ar(i,0) & "<br>"
    > > ' next
    > > 'end if
    > >
    > > rs.close
    > > set rs = nothing
    > >
    > >

    >
    >
     
    Moshe, Aug 28, 2003
    #8
  9. Moshe

    Bob Barrows Guest

    I've never run into this. Can you provide a CREATE TABLE script for your
    table along with the stored procedure's creation script and some sample data
    so I can test this? It would really help if you provide the sample data in
    the form of an insert statement:
    INSERT table VALUES(,,,,)

    Bob Barrows
    Moshe wrote:
    > No, it's not an html issue or something simple. I think it may have
    > to do with configuration or some other component on the server. I
    > just thought someone may have run across this.
    >
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
    > message news:...
    >> This code, after uncommenting it, works as expected for me. ? It's
    >> not an html issue is it, where your results actually are coming back
    >> but they're not displayed because of a missing quote or something,
    >> is it? View source? Just grasping at straws.
    >>
    >> Ray at work
    >>
    >> "Moshe" <> wrote in message
    >> news:...
    >>>
    >>> IN the code below, i try it using the array, then try it using the
    >>> recorset. In all, 14 fields are returned.
    >>>
    >>> set rs = cn.execute("spGetInfo 10, 20")
    >>>
    >>> '-- use this portion to display info via Recordset
    >>> if not rs.eof then
    >>> for i = 0 to 14
    >>> response.write i & ": " & rs(i) & "<br>"
    >>> next
    >>> end if
    >>>
    >>> '-- use this portion to display info via Array
    >>> 'if not rs.eof then
    >>> ' ar = rs.getrows
    >>> ' for i = 0 to ubound(ar,1)
    >>> ' response.write i & ": " & ar(i,0) & "<br>"
    >>> ' next
    >>> 'end if
    >>>
    >>> rs.close
    >>> set rs = nothing
     
    Bob Barrows, Aug 28, 2003
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Croney69

    Using GetRows()

    Croney69, Jul 28, 2003, in forum: ASP General
    Replies:
    5
    Views:
    184
    Bob Barrows
    Jul 28, 2003
  2. Crane Linkledder

    Difference between getrows and getstring

    Crane Linkledder, Oct 29, 2003, in forum: ASP General
    Replies:
    11
    Views:
    285
    Aaron Bertrand - MVP
    Oct 30, 2003
  3. Jim

    GetRows Random <td></td> Output

    Jim, Nov 21, 2003, in forum: ASP General
    Replies:
    1
    Views:
    121
    Jeff Clark
    Nov 22, 2003
  4. Harag

    JScript & GetRows

    Harag, Dec 27, 2003, in forum: ASP General
    Replies:
    4
    Views:
    221
    The Mighty Chaffinch
    Dec 28, 2003
  5. Patrick G.

    Remove items from GetRows array

    Patrick G., Feb 27, 2004, in forum: ASP General
    Replies:
    2
    Views:
    186
    Patrick G.
    Feb 27, 2004
Loading...

Share This Page