Click here to Skip to main content
15,915,164 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCan you tell me if there is an Add-in for Visual Studio too see contents of HDC, HBitmaps, etc Pin
materatsu24-May-08 19:44
materatsu24-May-08 19:44 
AnswerRe: Can you tell me if there is an Add-in for Visual Studio too see contents of HDC, HBitmaps, etc Pin
Iain Clarke, Warrior Programmer25-May-08 0:42
Iain Clarke, Warrior Programmer25-May-08 0:42 
Questionfloat problems [modified] Pin
shaderx24-May-08 10:44
shaderx24-May-08 10:44 
AnswerRe: float problems Pin
Jijo.Raj24-May-08 19:43
Jijo.Raj24-May-08 19:43 
GeneralRe: float problems [modified] Pin
shaderx24-May-08 21:57
shaderx24-May-08 21:57 
GeneralRe: float problems Pin
Jijo.Raj24-May-08 23:26
Jijo.Raj24-May-08 23:26 
GeneralRe: float problems Pin
shaderx24-May-08 23:30
shaderx24-May-08 23:30 
QuestionODBC ms access insertion problem via mfc Pin
elegantcharm24-May-08 9:07
elegantcharm24-May-08 9:07 
hi,
This is code i am using I've picked it from some where and I've changed it according to my requirements but its not inserting a new record. it gives error like attempt failed or record set is read only. I don't know i am using dynaset as an opening mode but still i get the error. kindly any one knows where i am going wrong.


CDatabase *mydb=new CDatabase;
ASSERT(mydb);
mydb->OpenEx("DSN=ff");

if(!mydb->IsOpen())
{

MessageBox("Unable to connect to Database. Please\ncontact your server administrator.", "Database Error", MB_ICONEXCLAMATION);
return;
}
CRecordset*myrec=new CRecordset(mydb);
ASSERT(myrec);
myrec->Open(CRecordset::dynaset,_T("SELECT s,p FROM e"),CRecordset::noDirtyFieldCheck);


if(!myrec->CanUpdate())
{
MessageBox("Database reports unable to update.", "Database Error", MB_ICONEXCLAMATION);
myrec->Close();
return;
}

if(!set.Open(CRecordset::dynaset,"SELECT * From e",CRecordset::noDirtyFieldCheck))
{
MessageBox("Unable to open database record. (SELECT * e)", "Database Error", MB_ICONEXCLAMATION);
set.Close();
return;
}
/*if (!set.CanAppend())
{
MessageBox("Database does not support adding records. Please\ncontact your server administrator.", "Database Error", MB_ICONEXCLAMATION);
set.Close();

}*/
set.MoveFirst();
while( !set.IsEOF() )
{
set.MoveNext();
}
int lRecCnt = set.GetRecordCount();
int newID=lRecCnt+2;

m_g=lRecCnt;
UpdateData(FALSE);


// Prepare for a new record addition.
try
{
set.MoveLast();
set.AddNew();
set.m_s = "Becky Dugan";
set.m_p = "Becky Dugan";

set.Requery();
set.SetFieldDirty(NULL);
set.Update();


}
catch(CException* pE)
{

char buf[256];
pE->GetErrorMessage(buf, 256, NULL);
AfxMessageBox(buf);
pE->Delete();
}

// Close Recordset
set.Close();
// Close Database
mydb->Close();
AnswerRe: ODBC ms access insertion problem via mfc Pin
prasad_som24-May-08 23:44
prasad_som24-May-08 23:44 
GeneralRe: ODBC ms access insertion problem via mfc Pin
elegantcharm27-May-08 9:05
elegantcharm27-May-08 9:05 
Questiontrace program for symantic Pin
sofia_11124-May-08 7:03
sofia_11124-May-08 7:03 
AnswerRe: trace program for symantic Pin
Jijo.Raj24-May-08 7:44
Jijo.Raj24-May-08 7:44 
GeneralRe: trace program for symantic Pin
sofia_11124-May-08 11:19
sofia_11124-May-08 11:19 
JokeRe: trace program for symantic Pin
Nelek24-May-08 15:28
protectorNelek24-May-08 15:28 
GeneralRe: trace program for symantic Pin
Jijo.Raj24-May-08 19:10
Jijo.Raj24-May-08 19:10 
JokeRe: trace program for symantic Pin
tina->newcoder24-May-08 21:32
tina->newcoder24-May-08 21:32 
GeneralRe: trace program for symantic Pin
sofia_11125-May-08 9:56
sofia_11125-May-08 9:56 
GeneralRe: trace program for symantic Pin
sofia_11125-May-08 10:03
sofia_11125-May-08 10:03 
GeneralRe: trace program for symantic Pin
sofia_11124-May-08 11:37
sofia_11124-May-08 11:37 
QuestionCHeckListBox + Edit Box ! Pin
Joseph Marzbani24-May-08 4:10
Joseph Marzbani24-May-08 4:10 
AnswerRe: CHeckListBox + Edit Box ! [modified] Pin
Rajkumar R24-May-08 5:17
Rajkumar R24-May-08 5:17 
GeneralRe: CHeckListBox + Edit Box ! Pin
Joseph Marzbani25-May-08 3:27
Joseph Marzbani25-May-08 3:27 
AnswerRe: CHeckListBox + Edit Box ! Pin
Hamid_RT24-May-08 5:18
Hamid_RT24-May-08 5:18 
QuestionRemote thread~dll Help me!Please!!! Pin
wzcprince24-May-08 3:35
wzcprince24-May-08 3:35 
AnswerRe: Remote thread~dll Help me!Please!!! Pin
ThatsAlok25-May-08 23:07
ThatsAlok25-May-08 23:07 

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.