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

C / C++ / MFC

 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr4-Dec-09 8:02
Larry Mills Sr4-Dec-09 8:02 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow4-Dec-09 9:06
David Crow4-Dec-09 9:06 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr4-Dec-09 13:52
Larry Mills Sr4-Dec-09 13:52 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow7-Dec-09 2:59
David Crow7-Dec-09 2:59 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr7-Dec-09 5:13
Larry Mills Sr7-Dec-09 5:13 
QuestionRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow7-Dec-09 5:27
David Crow7-Dec-09 5:27 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr7-Dec-09 5:35
Larry Mills Sr7-Dec-09 5:35 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow7-Dec-09 8:49
David Crow7-Dec-09 8:49 
Larry Mills Sr wrote:
CString CMyDB::GetDefaultConnect()
{
return _T("DBQ=C:\\CookIt\\Program\\DataBases\\DB\\CookIt.mdb;DefaultDir=C:\\CookIt\\Program\\DataBases\\DB;Driver={Driver do Microsoft Access (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\\CookIt\\Program\\DataBases\\DB\\CookIt.mdb.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;");
}


This looks odd. Mine always have the form:
return _T("ODBC;DSN=Gymnastics");
All of those other values (e.g., database, sizes) are defined in the DSN itself.

In my CDocument class, I have a CDatabase object. Anytime I need access to it, I use:
CDatabase *CMyDoc::GetDatabase( void )
{
    if (! m_rDatabase.IsOpen())
        m_rDatabase.Open(NULL, NULL, FALSE, _T("ODBC;DSN=Gymnastics"));
  
    return (&m_rDatabase);
}
When I want to add to a table, I use:
CMyRecordset set;
set.m_pDatabase = GetDocument()->GetDatabase();
  
TRY
{
    set.Open();
    set.AddNew();
    ...
    set.Update();
    set.Close();
}
CATCH(CDBException, pDBException)
{
    AfxMessageBox(pDBException->m_strError);
}
END_CATCH


"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons


GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr7-Dec-09 13:30
Larry Mills Sr7-Dec-09 13:30 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow8-Dec-09 3:24
David Crow8-Dec-09 3:24 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? [modified] Pin
Larry Mills Sr7-Dec-09 14:05
Larry Mills Sr7-Dec-09 14:05 
QuestionRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow8-Dec-09 3:20
David Crow8-Dec-09 3:20 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr8-Dec-09 4:12
Larry Mills Sr8-Dec-09 4:12 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr9-Dec-09 4:25
Larry Mills Sr9-Dec-09 4:25 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow9-Dec-09 4:29
David Crow9-Dec-09 4:29 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr9-Dec-09 4:47
Larry Mills Sr9-Dec-09 4:47 
QuestionMessage mapping Pin
msr_codeproject29-Nov-09 6:56
msr_codeproject29-Nov-09 6:56 
AnswerRe: Message mapping Pin
«_Superman_»29-Nov-09 8:15
professional«_Superman_»29-Nov-09 8:15 
AnswerRe: Message mapping Pin
Rajesh R Subramanian29-Nov-09 8:18
professionalRajesh R Subramanian29-Nov-09 8:18 
QuestionDev C++ cant accept vector?? Pin
nuttynibbles29-Nov-09 5:10
nuttynibbles29-Nov-09 5:10 
AnswerRe: Dev C++ cant accept vector?? Pin
Rajesh R Subramanian29-Nov-09 5:19
professionalRajesh R Subramanian29-Nov-09 5:19 
GeneralRe: Dev C++ cant accept vector?? [modified] Pin
nuttynibbles29-Nov-09 6:40
nuttynibbles29-Nov-09 6:40 
GeneralRe: Dev C++ cant accept vector?? Pin
Rajesh R Subramanian29-Nov-09 6:54
professionalRajesh R Subramanian29-Nov-09 6:54 
GeneralRe: Dev C++ cant accept vector?? Pin
nuttynibbles29-Nov-09 6:57
nuttynibbles29-Nov-09 6:57 
AnswerRe: Dev C++ cant accept vector?? Pin
Sarath C29-Nov-09 13:27
Sarath C29-Nov-09 13:27 

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.