Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Modify contents of tooltip on mouse over filename Pin
Iain Clarke, Warrior Programmer31-Jul-07 3:07
Iain Clarke, Warrior Programmer31-Jul-07 3:07 
QuestionODBC Database Function Query Pin
Programm3r31-Jul-07 0:53
Programm3r31-Jul-07 0:53 
AnswerRe: ODBC Database Function Query Pin
mandanani31-Jul-07 1:14
mandanani31-Jul-07 1:14 
GeneralRe: ODBC Database Function Query Pin
Programm3r31-Jul-07 1:32
Programm3r31-Jul-07 1:32 
GeneralRe: ODBC Database Function Query Pin
James R. Twine31-Jul-07 2:58
James R. Twine31-Jul-07 2:58 
GeneralRe: ODBC Database Function Query Pin
Programm3r31-Jul-07 3:02
Programm3r31-Jul-07 3:02 
GeneralRe: ODBC Database Function Query Pin
James R. Twine31-Jul-07 3:21
James R. Twine31-Jul-07 3:21 
AnswerRe: ODBC Database Function Query Pin
Hamed Musavi31-Jul-07 4:32
Hamed Musavi31-Jul-07 4:32 
As others mentioned here, using Stored procedures is the best choice. However if you are using MFC with ODBC, you can do this:

CTablePatient derived from CRecordSet
...
	CTablePatient tablePatient;

	tablePatient.m_strFilter.Format("PK=%ld", atol(m_szPID));
	tablePatient.Open();

        // if record does not exists
	if (tablePatient.IsEOF())
	{
		tablePatient.AddNew();
	}
	else
	{
                // Record is there already, so prepair it for edit
		tablePatient.Edit();
	}

        // Now we actually edit/set fields
	tablePatient.m_Name = m_szName;
	tablePatient.m_Birthday  = m_birthday;
...
        // Now update changes, whether add or edit
	tablePatient.Update();
	tablePatient.Close();


If you want to create a stored procedure and use it in an MFC app either, This tool will save your life:
http://www.codeproject.com/database/spcw.asp[^]

// "Life is very short and is very fragile also." Yanni
while (I'm_alive)
{
cout<<"I love programming.";
}

GeneralRe: ODBC Database Function Query Pin
Programm3r31-Jul-07 4:43
Programm3r31-Jul-07 4:43 
GeneralRe: ODBC Database Function Query [modified] Pin
Hamed Musavi31-Jul-07 5:07
Hamed Musavi31-Jul-07 5:07 
QuestionWriting to a file Pin
tom groezer31-Jul-07 0:51
tom groezer31-Jul-07 0:51 
AnswerRe: Writing to a file Pin
prasad_som31-Jul-07 0:56
prasad_som31-Jul-07 0:56 
QuestionPostthread message Pin
shakumar_2231-Jul-07 0:50
shakumar_2231-Jul-07 0:50 
AnswerRe: Postthread message Pin
prasad_som31-Jul-07 0:59
prasad_som31-Jul-07 0:59 
AnswerRe: Postthread message Pin
mandanani31-Jul-07 1:06
mandanani31-Jul-07 1:06 
GeneralRe: Postthread message Pin
mandanani31-Jul-07 1:17
mandanani31-Jul-07 1:17 
GeneralRe: Postthread message Pin
shakumar_2231-Jul-07 1:50
shakumar_2231-Jul-07 1:50 
GeneralRe: Postthread message Pin
James R. Twine31-Jul-07 3:03
James R. Twine31-Jul-07 3:03 
AnswerRe: Postthread message Pin
Iain Clarke, Warrior Programmer31-Jul-07 3:14
Iain Clarke, Warrior Programmer31-Jul-07 3:14 
Questionprivilege given to a user [modified] Pin
sheetal_0631-Jul-07 0:48
sheetal_0631-Jul-07 0:48 
AnswerRe: privilege given to a user Pin
Nelek31-Jul-07 0:58
protectorNelek31-Jul-07 0:58 
QuestionRe: privilege given to a user Pin
Nelek31-Jul-07 0:58
protectorNelek31-Jul-07 0:58 
QuestionRe: privilege given to a user Pin
David Crow31-Jul-07 2:28
David Crow31-Jul-07 2:28 
GeneralRe: privilege given to a user Pin
Programm3r31-Jul-07 1:01
Programm3r31-Jul-07 1:01 
AnswerRe: privilege given to a user Pin
sheetal_0631-Jul-07 1:01
sheetal_0631-Jul-07 1:01 

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.