Click here to Skip to main content
14,364,863 members

C / C++ / MFC

 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Richard MacCutchan19-Sep-19 6:24
protectorRichard MacCutchan19-Sep-19 6:24 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:36
memberMember 1457555619-Sep-19 6:36 
QuestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 6:39
memberDavid Crow19-Sep-19 6:39 
AnswerRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:53
memberMember 1457555619-Sep-19 6:53 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Richard MacCutchan19-Sep-19 7:09
protectorRichard MacCutchan19-Sep-19 7:09 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:23
memberMember 1457555619-Sep-19 7:23 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 7:11
memberVictor Nijegorodov19-Sep-19 7:11 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:21
memberMember 1457555619-Sep-19 7:21 
MedicineDlg MedicineObj;


It is an object for MedicineDlg.

void MedicationDlg::OnBnClickedSaveButtonMedicationDlg()
{
	// TODO: Add your control notification handler code here
	CString m_MedStatusInput, m_MedCommentInput, m_MedDoseInput, m_MedRouteInput, SqlQuery;
	m_MedDose_MedicationDlg.GetLBText(m_MedDose_MedicationDlg.GetCurSel(), m_MedDoseInput);
	m_MedRoute_MedicationDlg.GetLBText(m_MedRoute_MedicationDlg.GetCurSel(), m_MedRouteInput);
	UpdateData(TRUE);
	m_MedStatusInput = m_MedStatus_MedicationDlg;
	m_MedCommentInput = m_MedComments_MedicationDlg;
	
	CDatabase dbobj;
	dbobj.OpenEx(_T("DSN=Demo;UID=root;PWD=root"));
	CRecordset recset(&dbobj);
	SqlQuery.Format(_T("UPDATE dbdemo.medicine SET Route = '%s', Dose = '%s',Status = '%s',Comment = '%s' WHERE NDC ='%s'"), m_MedRouteInput, m_MedDoseInput, m_MedStatusInput, m_MedCommentInput, m_MedDSNInput);
	dbobj.ExecuteSQL(SqlQuery);//till here its working
	MedicineDlg MedicineObj;
	MedicineObj.ResetListControl();// Here the code breaks
	MedicineObj.DatabaseReload();
	
	OnOK();
	
}

GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 7:33
memberVictor Nijegorodov19-Sep-19 7:33 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:37
memberMember 1457555619-Sep-19 7:37 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 9:12
memberVictor Nijegorodov19-Sep-19 9:12 
AnswerRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 7:47
memberDavid Crow19-Sep-19 7:47 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 7:50
memberMember 1457555619-Sep-19 7:50 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 9:09
memberVictor Nijegorodov19-Sep-19 9:09 
SuggestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 10:29
memberDavid Crow19-Sep-19 10:29 
QuestionDetermining length of Switch compare Pin
ForNow18-Sep-19 16:45
memberForNow18-Sep-19 16:45 
AnswerRe: Determining length of Switch compare Pin
Peter_in_278018-Sep-19 17:49
professionalPeter_in_278018-Sep-19 17:49 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 2:32
memberForNow19-Sep-19 2:32 
AnswerRe: Determining length of Switch compare Pin
Richard MacCutchan18-Sep-19 21:55
protectorRichard MacCutchan18-Sep-19 21:55 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 2:32
memberForNow19-Sep-19 2:32 
AnswerRe: Determining length of Switch compare Pin
Stefan_Lang19-Sep-19 3:23
memberStefan_Lang19-Sep-19 3:23 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 5:06
memberForNow19-Sep-19 5:06 
AnswerRe: Determining length of Switch compare Pin
leon de boer19-Sep-19 5:38
memberleon de boer19-Sep-19 5:38 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 6:11
memberForNow19-Sep-19 6:11 
GeneralRe: Determining length of Switch compare Pin
leon de boer28-Sep-19 15:57
memberleon de boer28-Sep-19 15:57 

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.