Click here to Skip to main content
15,916,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionbegineer in COM facing problem Pin
GauranG Shah14-Sep-07 0:47
GauranG Shah14-Sep-07 0:47 
AnswerRe: begineer in COM facing problem Pin
Cedric Moonen14-Sep-07 1:03
Cedric Moonen14-Sep-07 1:03 
GeneralRe: begineer in COM facing problem Pin
GauranG Shah14-Sep-07 1:10
GauranG Shah14-Sep-07 1:10 
GeneralRe: begineer in COM facing problem Pin
led mike14-Sep-07 4:41
led mike14-Sep-07 4:41 
AnswerRe: begineer in COM facing problem Pin
nbugalia14-Sep-07 1:14
nbugalia14-Sep-07 1:14 
GeneralRe: begineer in COM facing problem Pin
GauranG Shah14-Sep-07 2:37
GauranG Shah14-Sep-07 2:37 
GeneralRe: begineer in COM facing problem Pin
nbugalia14-Sep-07 3:58
nbugalia14-Sep-07 3:58 
QuestionODBC readOnly problem Pin
Wamuti14-Sep-07 0:28
Wamuti14-Sep-07 0:28 
Hi!
I am trying to add information in an access database but when i try sending the information to the database, i keep getting the error message that the record set is read Only. I expected it to be the default "CRecordset::none" flag but i don't know what the problem is. The database has two table but currently i am using only one.In the appWizard i choose to include the two tables.
Below is the code that i have attached to the "add records" button:
(I haven't finished attatching all the CEdit controls becaue of the problem.) Please Help

void CRegistrationView::OnAddrecords()
{
// TODO: Add your command handler code here

// TODO: Add your command handler code here
// Get a pointer to the record set
CRecordset* pSet = OnGetRecordset();
// Make sure that any changes to the current record
// have been saved
if (pSet->CanUpdate() && !pSet->IsDeleted())
{
pSet->Edit();
if (!UpdateData())
return;

pSet->Update();
}


// Add the new record
m_pSet->AddNew();
// Set the registration(Primary Key) in the new record

m_pSet->m_Registration_Number=m_strNew_Registration_Number;

// Save the new record
m_pSet->Update();
// Refresh the record set
m_pSet->Requery();
// Move to the new record
m_pSet->MoveLast();
// Update the form
UpdateData(FALSE);
}

Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.

AnswerRe: ODBC readOnly problem Pin
David Crow14-Sep-07 3:00
David Crow14-Sep-07 3:00 
QuestionRe: ODBC readOnly problem Pin
David Crow14-Sep-07 3:01
David Crow14-Sep-07 3:01 
AnswerRe: ODBC readOnly problem Pin
Wamuti14-Sep-07 3:37
Wamuti14-Sep-07 3:37 
GeneralRe: ODBC readOnly problem Pin
David Crow14-Sep-07 4:18
David Crow14-Sep-07 4:18 
QuestionRe: ODBC readOnly problem Pin
Wamuti14-Sep-07 4:44
Wamuti14-Sep-07 4:44 
AnswerRe: ODBC readOnly problem Pin
David Crow14-Sep-07 4:50
David Crow14-Sep-07 4:50 
GeneralRe: ODBC readOnly problem Pin
Wamuti14-Sep-07 4:58
Wamuti14-Sep-07 4:58 
GeneralRe: ODBC readOnly problem Pin
David Crow14-Sep-07 6:02
David Crow14-Sep-07 6:02 
GeneralRe: ODBC readOnly problem Pin
Wamuti15-Sep-07 5:11
Wamuti15-Sep-07 5:11 
QuestionHow to run application Pin
john563213-Sep-07 23:23
john563213-Sep-07 23:23 
AnswerRe: How to run application Pin
Hamid_RT13-Sep-07 23:31
Hamid_RT13-Sep-07 23:31 
AnswerRe: How to run application Pin
nbugalia14-Sep-07 0:07
nbugalia14-Sep-07 0:07 
AnswerRe: How to run application Pin
Mark Salsbery14-Sep-07 7:15
Mark Salsbery14-Sep-07 7:15 
QuestionHow to automate the DSN creation for a database. Pin
chandu00413-Sep-07 23:04
chandu00413-Sep-07 23:04 
AnswerRe: How to automate the DSN creation for a database. Pin
jhwurmbach13-Sep-07 23:11
jhwurmbach13-Sep-07 23:11 
GeneralRe: How to automate the DSN creation for a database. Pin
chandu00413-Sep-07 23:19
chandu00413-Sep-07 23:19 
GeneralRe: How to automate the DSN creation for a database. Pin
jhwurmbach13-Sep-07 23:21
jhwurmbach13-Sep-07 23:21 

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.