Click here to Skip to main content
14,336,171 members

C / C++ / MFC

 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Richard MacCutchan19-Sep-19 5:24
protectorRichard MacCutchan19-Sep-19 5:24 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 5:36
memberMember 1457555619-Sep-19 5:36 
QuestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 5:39
memberDavid Crow19-Sep-19 5:39 
AnswerRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 5:53
memberMember 1457555619-Sep-19 5:53 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Richard MacCutchan19-Sep-19 6:09
protectorRichard MacCutchan19-Sep-19 6:09 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:23
memberMember 1457555619-Sep-19 6:23 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 6:11
memberVictor Nijegorodov19-Sep-19 6:11 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:21
memberMember 1457555619-Sep-19 6: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 6:33
memberVictor Nijegorodov19-Sep-19 6:33 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:37
memberMember 1457555619-Sep-19 6:37 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 8:12
memberVictor Nijegorodov19-Sep-19 8:12 
AnswerRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 6:47
memberDavid Crow19-Sep-19 6:47 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Member 1457555619-Sep-19 6:50
memberMember 1457555619-Sep-19 6:50 
GeneralRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
Victor Nijegorodov19-Sep-19 8:09
memberVictor Nijegorodov19-Sep-19 8:09 
SuggestionRe: MFC VC++ Repopulating the ClistCtrl after database is updated through dialog Pin
David Crow19-Sep-19 9:29
memberDavid Crow19-Sep-19 9:29 
QuestionDetermining length of Switch compare Pin
ForNow18-Sep-19 15:45
memberForNow18-Sep-19 15:45 
AnswerRe: Determining length of Switch compare Pin
Peter_in_278018-Sep-19 16:49
professionalPeter_in_278018-Sep-19 16:49 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 1:32
memberForNow19-Sep-19 1:32 
AnswerRe: Determining length of Switch compare Pin
Richard MacCutchan18-Sep-19 20:55
protectorRichard MacCutchan18-Sep-19 20:55 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 1:32
memberForNow19-Sep-19 1:32 
AnswerRe: Determining length of Switch compare Pin
Stefan_Lang19-Sep-19 2:23
memberStefan_Lang19-Sep-19 2:23 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 4:06
memberForNow19-Sep-19 4:06 
AnswerRe: Determining length of Switch compare Pin
leon de boer19-Sep-19 4:38
memberleon de boer19-Sep-19 4:38 
GeneralRe: Determining length of Switch compare Pin
ForNow19-Sep-19 5:11
memberForNow19-Sep-19 5:11 
GeneralRe: Determining length of Switch compare Pin
leon de boer28-Sep-19 14:57
memberleon de boer28-Sep-19 14: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.