Object Reference Error on ADODB.RecordSet Fields

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

  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. Similar Questions and Discussions

    1. adodb.recordset object and the IIS session object
      I was looking through the registry of a Windows 2000 Adv. Server I just built and noticed that the adodb.recordset object had been set to "both"...
    2. Help with ADODB.Recordset Error (0x800A0BB9)
      Hello, I'm having problems resolving ADODB.Recordset Error 0x800A0BB9. I'm running tutorial code from the Wrox Press book: Beginning ASP 3.0; Ch....
    3. Error Type: ADODB.Recordset (0x800A0BCD)
      Hi! I have a ASP page that generates an excel report. It works fine if there are records found, however, if no records are found I would like to...
    4. Connection error: ADODB.Recordset (0x800A0E7D)
      I have been copying and pasting code and this has been working, but now I get this error: Error Type: ADODB.Recordset (0x800A0E7D) Operation is...
    5. #25481 [Opn->Bgs]: ADOdb -> fields error
      ID: 25481 Updated by: sniper@php.net Reported By: zerokode at gmx dot net -Status: Open +Status: ...
  3. #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" <welkerdp@npt.nuwc.navy.mil> wrote in message
    news:uGJwsEfiDHA.944@tk2msftngp13.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

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