Click here to Skip to main content
15,887,950 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralResource Only DLL question Urgent! Pin
Binayak17-Dec-03 11:24
Binayak17-Dec-03 11:24 
GeneralRe: Resource Only DLL question Urgent! Pin
Prakash Nadar17-Dec-03 16:42
Prakash Nadar17-Dec-03 16:42 
GeneralBest database classes for this purpose: not really a programming question Pin
pankajdaga17-Dec-03 11:21
pankajdaga17-Dec-03 11:21 
GeneralRe: Best database classes for this purpose: not really a programming question Pin
John M. Drescher17-Dec-03 17:09
John M. Drescher17-Dec-03 17:09 
Generalquick question Pin
Qbus17-Dec-03 10:41
Qbus17-Dec-03 10:41 
GeneralRe: quick question Pin
Terry O'Nolley17-Dec-03 12:34
Terry O'Nolley17-Dec-03 12:34 
GeneralRe: quick question Pin
sam India17-Dec-03 17:47
sam India17-Dec-03 17:47 
GeneralCRecordset, ODBC, and Access Pin
David Crow17-Dec-03 8:34
David Crow17-Dec-03 8:34 
I've a table in an Access database with an AutoNumber field. When I add a row to the table through a CRecordset object, I want to know the value of the AutoNumber field. I've read various articles on how this is done, but none of them work. The code basically looks like:

CMyRecordset set;
CDBVariant bookmark;
set.Open(AFX_DB_USE_DEFAULT_TYPE, NULL, CRecordset::useBookmarks);
set.AddNew();
set.field1 = 123;
set.field2 = 456;
...
set.GetBookmark(bookmark);
// the value of 'bookmark' at this point is invalid since the recordset has
not been updated
 
set.Update(); // this adds the new record, but also makes the first record
the current one
 
set.Requery();
set.SetBookmark(bookmark); // this has no effect
I successfully use bookmarks in other areas of the program when editing rows. I populate a listbox with each record in a recordset and assign the AutoNumber field using SetItemData(). When an item in the listbox is selected and the Edit button is clicked, I have the correct bookmark and can then use SetBookmark() and Edit() successfully. Using this scenario, if a newly added listbox item does not have a correct bookmark associated with it, SetBookmark() cannot be used prior to Edit() or Delete() calls. In other words, I have no way to navigate to the desired record.

Any ideas for this long-winded request?

Thanks,
DC


Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?

GeneralRe: CRecordset, ODBC, and Access Pin
Terry O'Nolley17-Dec-03 12:39
Terry O'Nolley17-Dec-03 12:39 
GeneralRe: CRecordset, ODBC, and Access Pin
David Crow18-Dec-03 2:51
David Crow18-Dec-03 2:51 
GeneralRe: CRecordset, ODBC, and Access Pin
Terry O'Nolley18-Dec-03 8:19
Terry O'Nolley18-Dec-03 8:19 
GeneralRe: CRecordset, ODBC, and Access Pin
sam India17-Dec-03 18:21
sam India17-Dec-03 18:21 
GeneralRe: CRecordset, ODBC, and Access Pin
David Crow18-Dec-03 2:40
David Crow18-Dec-03 2:40 
GeneralOWL to MFC Pin
olezhik17-Dec-03 8:16
olezhik17-Dec-03 8:16 
GeneralRe: OWL to MFC Pin
Jörgen Sigvardsson17-Dec-03 8:24
Jörgen Sigvardsson17-Dec-03 8:24 
GeneralRe: OWL to MFC Pin
Terry O'Nolley17-Dec-03 12:40
Terry O'Nolley17-Dec-03 12:40 
GeneralRe: OWL to MFC Pin
Anthony_Yio17-Dec-03 15:56
Anthony_Yio17-Dec-03 15:56 
GeneralRe: OWL to MFC Pin
Joe Woodbury18-Dec-03 5:31
professionalJoe Woodbury18-Dec-03 5:31 
GeneralHardware Interfacing Pin
Member 17799617-Dec-03 7:05
Member 17799617-Dec-03 7:05 
GeneralRe: Hardware Interfacing Pin
Nitron17-Dec-03 7:16
Nitron17-Dec-03 7:16 
GeneralRe: Hardware Interfacing Pin
John M. Drescher17-Dec-03 7:30
John M. Drescher17-Dec-03 7:30 
GeneralRe: Hardware Interfacing Pin
Peter Molnar17-Dec-03 13:25
Peter Molnar17-Dec-03 13:25 
QuestionAutomated Windows testing tools...??? Pin
vlusardi17-Dec-03 5:41
vlusardi17-Dec-03 5:41 
AnswerRe: Automated Windows testing tools...??? Pin
Peter Molnar17-Dec-03 13:16
Peter Molnar17-Dec-03 13:16 
General_beginthreadex() problem... Pin
jhoin17-Dec-03 4:04
jhoin17-Dec-03 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.