SQL - CRecordSet

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

Mike_at_Nestor
Date: 02/28/05


Date: Mon, 28 Feb 2005 11:07:28 +0100

Hi !

I am trying to use MFC and CRecordSet class to manage a database.
My database is on MSDE or Interbase servers. Some fiels are "auto
incremented". This works well.

My problem is " how to retreive the newly added record". How can I retreive
the ID (or default fields) of my new record after a CRecordSet::Update( ) ?

First I call CRecordSet::AddNew( ), then I specify all needed fields and
then I call CRecordSet::Update( ).
The contents of my record set after the Update method is always the content
of the currently selected record before the AddNew call.

I'd like to know what are the default fields (or special fields like auto
increment) filled in after addnew / update.

thanks
Mike



Relevant Pages

  • Re: [PHP] Re: Getting last record ID created from DB
    ... My own knowledge of mysql is about 5 years old and never really used. ... Unfortunately auto increment is MySQL specific and so it isn't ... transferrable to other database engines. ...
    (php.general)
  • Re: INSERT INTO on CHAR fieldtype with auto increment?
    ... If you have no gaps left, you HAVE to increment the siblings in the node and sub-nodes because your left/right pairing is not verifiable to the original data. ... because you have changed the left/right values all those systems are now wrong and worse still actually relate the originally stored information incorrectly to an entirely different "fact" within the database. ... if you are saying that its ok for the left/right pair to change because an insert into the hierarchy means a new hierarhcy than I remind you.... ...
    (microsoft.public.sqlserver.programming)
  • RE: Incrementing a number and avoiding duplicates
    ... entered and create the number in the After Update event. ... I see you had another post with a way to increment the number. ... The database is on a file server and a few user will access this ... How can I avoid to have duplicates ...
    (microsoft.public.access.modulesdaovba)
  • Re: CFT: vr(4)
    ... database for several months. ... reliably detect link state changes. ... on miibus1 ... 100baseTX-FDX, auto ...
    (freebsd-current)
  • Problem: How to resize FreeBSD "partitions" on a live system?
    ... I have found that with the auto defaults, ... out of control (heavy database; lots of spam filling up logs, ...
    (comp.unix.bsd.freebsd.misc)