Professional Web Applications Themes

Object Reference Error on ADODB.RecordSet Fields - ASP Database

One of my developers is working on a .Net web app that has a wee bit o legacy code in Page_Onload: .... Dim MySelect as String = "SELECT User FROM DUAL" Dim rs as ADODB.RecordSet rs.Open(MySelect,Conn) rs.MoveFirst UNam = rs.Fields("User").Value .... This code gets invoked separately from each of two web apps linked from an HTML page. The second web app fails to locate rs.Fields("User") and returns "Object reference not set to an instance of an object." but it DOES succeed in opening the recordset and retrieving a record. If we assign the row to an array A and retrieve ...

  1. #1

    Default Object Reference Error on ADODB.RecordSet Fields

    One of my developers is working on a .Net web app that has a wee bit o
    legacy code in Page_Onload:

    ....
    Dim MySelect as String = "SELECT User FROM DUAL"
    Dim rs as ADODB.RecordSet
    rs.Open(MySelect,Conn)
    rs.MoveFirst
    UNam = rs.Fields("User").Value
    ....

    This code gets invoked separately from each of two web apps linked from an
    HTML page.
    The second web app fails to locate rs.Fields("User") and returns "Object
    reference not set to an instance of an object." but it DOES succeed in
    opening the recordset and retrieving a record.

    If we assign the row to an array A and retrieve the value of A(0,0) we do
    indeed get the correct string (the username as seen by the database)?!

    Anybody got any ideas? (The connection is via Oracle 9.2)


    Donald Welker Guest

  2. #2

    Default Re: Object Reference Error on ADODB.RecordSet Fields

    ..NET doesn't like it when code assumes that it will use the default
    property, i.e. recordsetObject.fields.ITEM(index).value

    But I don't know that that is your problem. Take a look here.
    [url]http://www.aspfaq.com/5002[/url]

    Ray at work

    "Donald Welker" <welkerdpnpt.nuwc.navy.mil> wrote in message
    news:uGJwsEfiDHA.944tk2msftngp13.phx.gbl...
    > One of my developers is working on a .Net web app that has a wee bit o
    > legacy code in Page_Onload:
    >
    > ...
    > Dim MySelect as String = "SELECT User FROM DUAL"
    > Dim rs as ADODB.RecordSet
    > rs.Open(MySelect,Conn)
    > rs.MoveFirst
    > UNam = rs.Fields("User").Value
    > ...
    >
    > This code gets invoked separately from each of two web apps linked from an
    > HTML page.
    > The second web app fails to locate rs.Fields("User") and returns "Object
    > reference not set to an instance of an object." but it DOES succeed in
    > opening the recordset and retrieving a record.
    >
    > If we assign the row to an array A and retrieve the value of A(0,0) we do
    > indeed get the correct string (the username as seen by the database)?!
    >
    > Anybody got any ideas? (The connection is via Oracle 9.2)
    >
    >

    Ray at Guest

Similar Threads

  1. adodb.recordset object and the IIS session object
    By Mbtch@. in forum ASP Components
    Replies: 0
    Last Post: June 8th, 05:25 PM
  2. Help with ADODB.Recordset Error (0x800A0BB9)
    By Nick D. in forum ASP Database
    Replies: 6
    Last Post: May 2nd, 09:38 PM
  3. Replies: 1
    Last Post: October 21st, 04:22 PM
  4. Connection error: ADODB.Recordset (0x800A0E7D)
    By Tom Petersen in forum ASP
    Replies: 2
    Last Post: September 16th, 06:52 PM
  5. #25481 [Opn->Bgs]: ADOdb -> fields error
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: September 11th, 12:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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