Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDial up connections, please help Pin
Jump_Around2-Jun-03 23:03
Jump_Around2-Jun-03 23:03 
QuestionHow can I ignore the newline character when using fgets() Pin
jcpooh2-Jun-03 22:33
jcpooh2-Jun-03 22:33 
AnswerRe: How can I ignore the newline character when using fgets() Pin
David Crow3-Jun-03 2:52
David Crow3-Jun-03 2:52 
General!!illegal operation when clicking the edit box of CTreeView Pin
black19212-Jun-03 21:54
black19212-Jun-03 21:54 
GeneralRe: !!illegal operation when clicking the edit box of CTreeView Pin
black19212-Jun-03 21:56
black19212-Jun-03 21:56 
GeneralHelp !!! How to edit, append, read data from an access dbase file using CRecordset class Pin
mhar2-Jun-03 21:52
professionalmhar2-Jun-03 21:52 
GeneralRe: Help !!! How to edit, append, read data from an access dbase file using CRecordset class Pin
David Crow3-Jun-03 3:03
David Crow3-Jun-03 3:03 
GeneralRe: Help !!! How to edit, append, read data from an access dbase file using CRecordset class Pin
mhar3-Jun-03 14:21
professionalmhar3-Jun-03 14:21 
Hi David,

This is the message i encountered:
"Could not update;currently locked by user 'admin' on machine 'P1-MAR' "


Here is my code....


CTestSummary pTestSummary(NULL); // CTestSummary is derived from CRecordset class
pTestSummary.m_strFilter = "HANDLER_NAME = \'" + current_handler_name + "\'"; // select only target handler
if(pTestSummary.Open(CRecordset::dynaset,NULL)!=0)
{
pTestSummary.Edit(); // open for editing
pTestSummary.m_graph_half1 = half1; //saved the first 240 characters
pTestSummary.m_graph_half2 = half2; // saved the next 240 characters
pTestSummary.m_graph_date_time_stamp = string_default; //saved the current date time stamp
pTestSummary.Update();
}


I have several program that simultaneously edit thesame database file. I have read some documents from CRecordset class
that there will be some problem if Update() function is executed from each program , if just in case they occur at thesame time.
Is there's a way I could get some error trapping when accessing database file so that I could just bypass the Update() function if I
encountered this error. As for now, the default message box by window always show if one of this Update() failed.

Here is the construction of CTestSummary class... I use class wizard to create it..

// TestSummary.cpp : implementation file
//

#include "stdafx.h"
#include "clisock.h"
#include "TestSummary.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTestSummary

IMPLEMENT_DYNAMIC(CTestSummary, CRecordset)

CTestSummary::CTestSummary(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CTestSummary)
m_graph_half1 = _T("");
m_graph_half2 = _T("");
m_graph_date_time_stamp = _T("");
m_nFields = 3;
//}}AFX_FIELD_INIT
m_nDefaultType = dynaset;
}


CString CTestSummary::GetDefaultConnect()
{
return _T("ODBC;DSN=mddb;UID=Admin;PWD=xxxxxx");
}

CString CTestSummary::GetDefaultSQL()
{
return _T("[MachineDetails]");
}

void CTestSummary::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CTestSummary)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text(pFX, _T("[graph_half1]"), m_graph_half1);
RFX_Text(pFX, _T("[graph_half2]"), m_graph_half2);
RFX_Text(pFX, _T("[graph_date_time_stamp]"), m_graph_date_time_stamp);
//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CTestSummary diagnostics

#ifdef _DEBUG
void CTestSummary::AssertValid() const
{
CRecordset::AssertValid();
}

void CTestSummary::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG

I would appreciate if you could help me on this...

Thanks,

MarSmile | :)


Mar Solero Jr.
GeneralRe: Help !!! How to edit, append, read data from an access dbase file using CRecordset class Pin
David Crow4-Jun-03 2:50
David Crow4-Jun-03 2:50 
GeneralDLL as an extra process Pin
AnTri2-Jun-03 21:51
AnTri2-Jun-03 21:51 
GeneralRe: DLL as an extra process Pin
Anna-Jayne Metcalfe3-Jun-03 0:02
Anna-Jayne Metcalfe3-Jun-03 0:02 
GeneralRe: DLL as an extra process Pin
AnTri3-Jun-03 0:54
AnTri3-Jun-03 0:54 
GeneralRe: DLL as an extra process Pin
Anna-Jayne Metcalfe3-Jun-03 1:10
Anna-Jayne Metcalfe3-Jun-03 1:10 
GeneralRe: DLL as an extra process Pin
AnTri3-Jun-03 1:17
AnTri3-Jun-03 1:17 
GeneralRe: DLL as an extra process Pin
Anna-Jayne Metcalfe3-Jun-03 1:46
Anna-Jayne Metcalfe3-Jun-03 1:46 
GeneralRe: DLL as an extra process Pin
Neville Franks3-Jun-03 2:16
Neville Franks3-Jun-03 2:16 
GeneralRe: DLL as an extra process Pin
Chris Richardson3-Jun-03 6:01
Chris Richardson3-Jun-03 6:01 
QuestionHow can I load and render 3dstudio files in visual c++? Pin
Mohsen Jamali2-Jun-03 21:46
Mohsen Jamali2-Jun-03 21:46 
AnswerRe: How can I load and render 3dstudio files in visual c++? Pin
Zizilamoroso2-Jun-03 23:32
Zizilamoroso2-Jun-03 23:32 
GeneralRe: How can I load and render 3dstudio files in visual c++? Pin
Anonymous6-Jun-03 19:51
Anonymous6-Jun-03 19:51 
GeneralRe: How can I load and render 3dstudio files in visual c++? Pin
Zizilamoroso8-Jun-03 6:19
Zizilamoroso8-Jun-03 6:19 
Generalcalling OpenDocumentFile from another thread Pin
Brian van der Beek2-Jun-03 21:22
Brian van der Beek2-Jun-03 21:22 
GeneralRe: calling OpenDocumentFile from another thread Pin
Neville Franks2-Jun-03 23:33
Neville Franks2-Jun-03 23:33 
GeneralRe: calling OpenDocumentFile from another thread Pin
Brian van der Beek3-Jun-03 0:37
Brian van der Beek3-Jun-03 0:37 
GeneralRe: calling OpenDocumentFile from another thread Pin
Neville Franks3-Jun-03 2:22
Neville Franks3-Jun-03 2:22 

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.