Click here to Skip to main content
15,887,376 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
Steve S11-Aug-03 21:59
Steve S11-Aug-03 21:59 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
suninwater11-Aug-03 22:48
suninwater11-Aug-03 22:48 
QuestionOnCtrlColor - how do I set a button fore color? Pin
michael thomas11-Aug-03 16:01
michael thomas11-Aug-03 16:01 
AnswerRe: OnCtrlColor - how do I set a button fore color? Pin
Ryan Binns11-Aug-03 20:04
Ryan Binns11-Aug-03 20:04 
GeneralRe: OnCtrlColor - how do I set a button fore color? Pin
michael thomas12-Aug-03 3:11
michael thomas12-Aug-03 3:11 
AnswerRe: OnCtrlColor - how do I set a button fore color? Pin
HPSI11-Aug-03 20:08
HPSI11-Aug-03 20:08 
GeneralRe: OnCtrlColor - how do I set a button fore color? Pin
michael thomas12-Aug-03 3:12
michael thomas12-Aug-03 3:12 
QuestionError "Recordset is read-only" ??? Pin
_skidrow_vn_11-Aug-03 15:56
_skidrow_vn_11-Aug-03 15:56 
I have 2 tables in mydatabase "Account" and "Employee"
I want to edit my record but there is a Error messagebox always show
-----------------------------
"Recordset is read-only"
-----------------------------
How can I fix it?
thanks
// I want to Edit password,permission of employee<br />
// who have ID="John"  >>>>>>  Account.ID="John" then.....<br />
// Account.Pass="John1" => edit to new password => Account.Pass="John2"<br />
// Employee.Permission=2 => edit to new permission => Employee.Permission=3<br />
<br />
<br />
<br />
<br />
// QLBH2Set.cpp : implementation of the CAccountSet class<br />
//<br />
IMPLEMENT_DYNAMIC(CAccountSet, CRecordset)<br />
CAccountSet::CAccountSet(CDatabase* pdb)<br />
	: CRecordset(pdb)<br />
{<br />
	m_ID = _T("");<br />
	m_Pass = _T("");<br />
	m_Employee_ID = _T("");<br />
	m_Permission = 0;<br />
	m_nFields = 4;<br />
	m_nDefaultType = dynaset;//snapshot;<br />
}<br />
<br />
CString CAccountSet::GetDefaultConnect()<br />
{<br />
	return _T("ODBC;DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\MyDB.mdb");<br />
}<br />
<br />
CString CAccountSet::GetDefaultSQL()<br />
{<br />
	return _T([Account],[Employee]);<br />
}<br />
<br />
void CAccountSet::DoFieldExchange(CFieldExchange* pFX)<br />
{<br />
	pFX->SetFieldType(CFieldExchange::outputColumn);<br />
	RFX_Text(pFX, _T("[ID]"), m_ID);<br />
	RFX_Text(pFX, _T("[Pass]"), m_Pass);	<br />
	RFX_Long(pFX, _T("[Permission]"), m_Permission);	<br />
	RFX_Text(pFX, _T("[Employee_ID]"), m_Employee_ID);<br />
}<br />
<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CChangePassword dialog<br />
class CChangePassword : public CDialog<br />
{<br />
// Construction<br />
public:<br />
	CChangePassword(CWnd* pParent = NULL);   // standard constructor<br />
<br />
	CAccountSet m_Set;<br />
.....<br />
}<br />
<br />
<br />
<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CChangePassword message handlers<br />
void CChangePassword::OnOK() <br />
{<br />
	.......<br />
	m_Set.m_strFilter = "Account.ID = Employee.Employee_ID";<br />
	m_Set.Open(CRecordset::dynaset,<br />
		_T( "SELECT ALL Account.ID,Account.Pass,Employee.Permission FROM Account INNER JOIN Employee ON Account.ID=Employee.Empoyee_ID" ),<br />
		CRecordset::executeDirect);<br />
	<br />
	// I want to Edit password,permission of employee<br />
	// who have ID="John"  >>>>>>  Account.ID="John"<br />
	// Account.Pass="John1" => edit to new password => Account.Pass="John2"<br />
	// Employee.Permission=2 => edit to new permission => Employee.Permission=3<br />
<br />
	m_Set.Edit();<br />
	m_Set.m_Pass = strNewPass;	<br />
	<br />
	m_Set.Update( ); <br />
	m_Set.Requery ();<br />
	m_Set.Close();<br />
	.....<br />
}

GeneralHandling message in parent window Pin
bitpusher11-Aug-03 15:26
bitpusher11-Aug-03 15:26 
GeneralRe: Handling message in parent window Pin
HPSI11-Aug-03 20:38
HPSI11-Aug-03 20:38 
GeneralI get an error with writing a string Pin
Snyp11-Aug-03 15:14
Snyp11-Aug-03 15:14 
GeneralRe: I get an error with writing a string Pin
bitpusher11-Aug-03 15:30
bitpusher11-Aug-03 15:30 
GeneralRe: I get an error with writing a string Pin
David Crow12-Aug-03 2:39
David Crow12-Aug-03 2:39 
QuestionNM_RELEASEDCAPTURE/Spin Control? Pin
Kayembi11-Aug-03 14:44
Kayembi11-Aug-03 14:44 
AnswerRe: NM_RELEASEDCAPTURE/Spin Control? Pin
Iain Clarke, Warrior Programmer11-Aug-03 23:19
Iain Clarke, Warrior Programmer11-Aug-03 23:19 
GeneralRe: NM_RELEASEDCAPTURE/Spin Control? Pin
Kayembi12-Aug-03 3:23
Kayembi12-Aug-03 3:23 
GeneralRe: NM_RELEASEDCAPTURE/Spin Control? Pin
Iain Clarke, Warrior Programmer12-Aug-03 5:02
Iain Clarke, Warrior Programmer12-Aug-03 5:02 
GeneralRe: NM_RELEASEDCAPTURE/Spin Control? Pin
Kayembi16-Aug-03 8:35
Kayembi16-Aug-03 8:35 
GeneralRe: NM_RELEASEDCAPTURE/Spin Control? Pin
Iain Clarke, Warrior Programmer16-Aug-03 13:19
Iain Clarke, Warrior Programmer16-Aug-03 13:19 
QuestionHow can I set a toolbar button to display an icon? Pin
ElizabethC11-Aug-03 12:24
ElizabethC11-Aug-03 12:24 
AnswerRe: How can I set a toolbar button to display an icon? Pin
Adi Narayana11-Aug-03 20:35
Adi Narayana11-Aug-03 20:35 
GeneralRe: How can I set a toolbar button to display an icon? Pin
ElizabethC12-Aug-03 6:48
ElizabethC12-Aug-03 6:48 
GeneralJob Object API Pin
bigeyedfish8111-Aug-03 11:38
bigeyedfish8111-Aug-03 11:38 
Generalva_arg and VS.NET 2003 Pin
leppie11-Aug-03 10:59
leppie11-Aug-03 10:59 
GeneralRe: va_arg and VS.NET 2003 Pin
Mike Dimmick11-Aug-03 11:13
Mike Dimmick11-Aug-03 11:13 

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.