dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Can't change field value in a recordset

  1. #1
    Craig Guest

    Can't change field value in a recordset

    Hi

    I'm having problems changing the value in a field from a recordset. Here's
    what I'm trying to do;

    1. Retrieve recordset from two databases. I call a stored procedure that
    returns a recordset with 39 fields, one of which is blank.

    2. I step through the recordset and use information in some fields to query
    another database (on a different server) to get the information that I want
    for the blank field.

    3. Assign the retrieved value to the blank field.

    4. Return the recordset from the function to be used in a web app.

    Steps, 1. 2. and 4. all work fine, but I can't get step 3. to work. I've
    tried a number of things, but I always get the following error;

    "Multiple-step operation generated errors. Check each status value."

    I've used rs("FieldName") = "" and rs.Fields("FieldName").value = ""

    I've also changed the properties for the recordset (cursor type, locking
    etc), to no avail. And I've tried using different fields int he recordset,
    in case I've done something strange for that particular field. I would have
    thought it would be easy to retrieve a recordset and change a field value
    for the current record, but I'm running out of ideas on this one.

    Thanks for any help you can offer.



  2. #2
    Leopoldo Rodriguez Guest

    Re: Can't change field value in a recordset


    You Can't do that because the stored procedure is only for you to retrieve
    data, not for updating ..

    Leopoldo R.

    "Craig" <cjewiss@nospam.hotmail.com> wrote:
    >Hi
    >
    >I'm having problems changing the value in a field from a recordset. Here's
    >what I'm trying to do;
    >
    >1. Retrieve recordset from two databases. I call a stored procedure that
    >returns a recordset with 39 fields, one of which is blank.
    >
    >2. I step through the recordset and use information in some fields to query
    >another database (on a different server) to get the information that I want
    >for the blank field.
    >
    >3. Assign the retrieved value to the blank field.
    >
    >4. Return the recordset from the function to be used in a web app.
    >
    >Steps, 1. 2. and 4. all work fine, but I can't get step 3. to work. I've
    >tried a number of things, but I always get the following error;
    >
    >"Multiple-step operation generated errors. Check each status value."
    >
    >I've used rs("FieldName") = "" and rs.Fields("FieldName").value = ""
    >
    >I've also changed the properties for the recordset (cursor type, locking
    >etc), to no avail. And I've tried using different fields int he recordset,
    >in case I've done something strange for that particular field. I would

    have
    >thought it would be easy to retrieve a recordset and change a field value
    >for the current record, but I'm running out of ideas on this one.
    >
    >Thanks for any help you can offer.
    >
    >



  3. #3
    Craig Guest

    Re: Can't change field value in a recordset

    So does that mean you can only make changes to recordset field values if the
    recordset is from a single table? (makes sense, I guess). Of course, I had
    no intention of issuing an update command. I just wanted to change a field
    value before handing the recordset onto the web app.

    Does anyone have any suggestions as to how I could acomplish my final goal
    (ie. data from two databases on one server, and then one field from another
    database on a differnet server).

    Thanks.
    "Leopoldo Rodriguez" <poloart@hotmail.com> wrote in message
    news:3a8c7f5f$1@news.devx.com...
    >
    > You Can't do that because the stored procedure is only for you to retrieve
    > data, not for updating ..
    >
    > Leopoldo R.
    >
    > "Craig" <cjewiss@nospam.hotmail.com> wrote:
    > >Hi
    > >
    > >I'm having problems changing the value in a field from a recordset.

    Here's
    > >what I'm trying to do;
    > >
    > >1. Retrieve recordset from two databases. I call a stored procedure

    that
    > >returns a recordset with 39 fields, one of which is blank.
    > >
    > >2. I step through the recordset and use information in some fields to

    query
    > >another database (on a different server) to get the information that I

    want
    > >for the blank field.
    > >
    > >3. Assign the retrieved value to the blank field.
    > >
    > >4. Return the recordset from the function to be used in a web app.
    > >
    > >Steps, 1. 2. and 4. all work fine, but I can't get step 3. to work. I've
    > >tried a number of things, but I always get the following error;
    > >
    > >"Multiple-step operation generated errors. Check each status value."
    > >
    > >I've used rs("FieldName") = "" and rs.Fields("FieldName").value = ""
    > >
    > >I've also changed the properties for the recordset (cursor type, locking
    > >etc), to no avail. And I've tried using different fields int he

    recordset,
    > >in case I've done something strange for that particular field. I would

    > have
    > >thought it would be easy to retrieve a recordset and change a field value
    > >for the current record, but I'm running out of ideas on this one.
    > >
    > >Thanks for any help you can offer.
    > >
    > >

    >




  4. #4
    a nil Guest

    Re: Can't change field value in a recordset


    You cannot directly change the values in a recordset returned by a stored
    procedure. They are of type static or readonly(I Think). The possible way
    is open another recordset with the specific condition in dyanamic mode and
    make the necessary changes or directly execute the SQL

    bye

    a nil


    "Leopoldo Rodriguez" <poloart@hotmail.com> wrote:
    >
    >You Can't do that because the stored procedure is only for you to retrieve
    >data, not for updating ..
    >
    >Leopoldo R.
    >
    >"Craig" <cjewiss@nospam.hotmail.com> wrote:
    >>Hi
    >>
    >>I'm having problems changing the value in a field from a recordset. Here's
    >>what I'm trying to do;
    >>
    >>1. Retrieve recordset from two databases. I call a stored procedure that
    >>returns a recordset with 39 fields, one of which is blank.
    >>
    >>2. I step through the recordset and use information in some fields to

    query
    >>another database (on a different server) to get the information that I

    want
    >>for the blank field.
    >>
    >>3. Assign the retrieved value to the blank field.
    >>
    >>4. Return the recordset from the function to be used in a web app.
    >>
    >>Steps, 1. 2. and 4. all work fine, but I can't get step 3. to work. I've
    >>tried a number of things, but I always get the following error;
    >>
    >>"Multiple-step operation generated errors. Check each status value."
    >>
    >>I've used rs("FieldName") = "" and rs.Fields("FieldName").value = ""
    >>
    >>I've also changed the properties for the recordset (cursor type, locking
    >>etc), to no avail. And I've tried using different fields int he recordset,
    >>in case I've done something strange for that particular field. I would

    >have
    >>thought it would be easy to retrieve a recordset and change a field value
    >>for the current record, but I'm running out of ideas on this one.
    >>
    >>Thanks for any help you can offer.
    >>
    >>

    >



  5. #5
    Kyle Guest

    Re: Can't change field value in a recordset


    Can you use the stored procedure to retreive the value for the blank field?
    Perhaps you could return that value as an output parameter. Just a thought....



    "a nil" <anil@infics.com> wrote:
    >
    >You cannot directly change the values in a recordset returned by a stored
    >procedure. They are of type static or readonly(I Think). The possible way
    >is open another recordset with the specific condition in dyanamic mode and
    >make the necessary changes or directly execute the SQL
    >
    >bye
    >
    >a nil
    >
    >
    >"Leopoldo Rodriguez" <poloart@hotmail.com> wrote:
    >>
    >>You Can't do that because the stored procedure is only for you to retrieve
    >>data, not for updating ..
    >>
    >>Leopoldo R.
    >>
    >>"Craig" <cjewiss@nospam.hotmail.com> wrote:
    >>>Hi
    >>>
    >>>I'm having problems changing the value in a field from a recordset. Here's
    >>>what I'm trying to do;
    >>>
    >>>1. Retrieve recordset from two databases. I call a stored procedure

    that
    >>>returns a recordset with 39 fields, one of which is blank.
    >>>
    >>>2. I step through the recordset and use information in some fields to

    >query
    >>>another database (on a different server) to get the information that I

    >want
    >>>for the blank field.
    >>>
    >>>3. Assign the retrieved value to the blank field.
    >>>
    >>>4. Return the recordset from the function to be used in a web app.
    >>>
    >>>Steps, 1. 2. and 4. all work fine, but I can't get step 3. to work. I've
    >>>tried a number of things, but I always get the following error;
    >>>
    >>>"Multiple-step operation generated errors. Check each status value."
    >>>
    >>>I've used rs("FieldName") = "" and rs.Fields("FieldName").value = ""
    >>>
    >>>I've also changed the properties for the recordset (cursor type, locking
    >>>etc), to no avail. And I've tried using different fields int he recordset,
    >>>in case I've done something strange for that particular field. I would

    >>have
    >>>thought it would be easy to retrieve a recordset and change a field value
    >>>for the current record, but I'm running out of ideas on this one.
    >>>
    >>>Thanks for any help you can offer.
    >>>
    >>>

    >>

    >



  6. #6
    Craig Guest

    Re: Can't change field value in a recordset

    No. The value is on a different server. One server is SQL 7, the other is
    SQL 6.5.

    "Kyle" <vhost98@yahoo.com> wrote in message news:3a8d3c24$1@news.devx.com...
    >
    > Can you use the stored procedure to retreive the value for the blank

    field?
    > Perhaps you could return that value as an output parameter. Just a

    thought....
    >
    >
    >
    > "a nil" <anil@infics.com> wrote:
    > >
    > >You cannot directly change the values in a recordset returned by a stored
    > >procedure. They are of type static or readonly(I Think). The possible way
    > >is open another recordset with the specific condition in dyanamic mode

    and
    > >make the necessary changes or directly execute the SQL
    > >
    > >bye
    > >
    > >a nil
    > >
    > >
    > >"Leopoldo Rodriguez" <poloart@hotmail.com> wrote:
    > >>
    > >>You Can't do that because the stored procedure is only for you to

    retrieve
    > >>data, not for updating ..
    > >>
    > >>Leopoldo R.
    > >>
    > >>"Craig" <cjewiss@nospam.hotmail.com> wrote:
    > >>>Hi
    > >>>
    > >>>I'm having problems changing the value in a field from a recordset.

    Here's
    > >>>what I'm trying to do;
    > >>>
    > >>>1. Retrieve recordset from two databases. I call a stored procedure

    > that
    > >>>returns a recordset with 39 fields, one of which is blank.
    > >>>
    > >>>2. I step through the recordset and use information in some fields to

    > >query
    > >>>another database (on a different server) to get the information that I

    > >want
    > >>>for the blank field.
    > >>>
    > >>>3. Assign the retrieved value to the blank field.
    > >>>
    > >>>4. Return the recordset from the function to be used in a web app.
    > >>>
    > >>>Steps, 1. 2. and 4. all work fine, but I can't get step 3. to work.

    I've
    > >>>tried a number of things, but I always get the following error;
    > >>>
    > >>>"Multiple-step operation generated errors. Check each status value."
    > >>>
    > >>>I've used rs("FieldName") = "" and rs.Fields("FieldName").value = ""
    > >>>
    > >>>I've also changed the properties for the recordset (cursor type,

    locking
    > >>>etc), to no avail. And I've tried using different fields int he

    recordset,
    > >>>in case I've done something strange for that particular field. I would
    > >>have
    > >>>thought it would be easy to retrieve a recordset and change a field

    value
    > >>>for the current record, but I'm running out of ideas on this one.
    > >>>
    > >>>Thanks for any help you can offer.
    > >>>
    > >>>
    > >>

    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center