Click here to Skip to main content
15,911,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: limit app to one instance Pin
tbrake10-May-06 10:24
tbrake10-May-06 10:24 
AnswerRe: limit app to one instance Pin
PJ Arends10-May-06 10:27
professionalPJ Arends10-May-06 10:27 
AnswerRe: limit app to one instance Pin
David Crow10-May-06 10:54
David Crow10-May-06 10:54 
AnswerRe: limit app to one instance Pin
ThatsAlok10-May-06 19:57
ThatsAlok10-May-06 19:57 
QuestionIs UNICODE required for my project Pin
benm9999999910-May-06 9:23
benm9999999910-May-06 9:23 
AnswerRe: Is UNICODE required for my project Pin
Joe Woodbury10-May-06 10:20
professionalJoe Woodbury10-May-06 10:20 
QuestionMulti Window With OpenGl Pin
F.Smadi10-May-06 8:33
F.Smadi10-May-06 8:33 
QuestionHow to get Admin rights for the process... Pin
nagamohan_p10-May-06 7:49
nagamohan_p10-May-06 7:49 
AnswerRe: How to get Admin rights for the process... Pin
Maxwell Chen10-May-06 8:09
Maxwell Chen10-May-06 8:09 
QuestionDll Debuging? Pin
G Haranadh10-May-06 7:40
G Haranadh10-May-06 7:40 
GeneralRe: Dll Debuging? Pin
Maxwell Chen10-May-06 7:45
Maxwell Chen10-May-06 7:45 
GeneralRe: Dll Debuging? Pin
Rick York10-May-06 8:05
mveRick York10-May-06 8:05 
GeneralRe: Dll Debuging? Pin
Maxwell Chen10-May-06 8:12
Maxwell Chen10-May-06 8:12 
GeneralRe: Dll Debuging? Pin
NiceNaidu10-May-06 19:24
NiceNaidu10-May-06 19:24 
Questionquery on Database support Pin
swapna_signsin10-May-06 6:20
swapna_signsin10-May-06 6:20 
GeneralRe: query on Database support Pin
Maxwell Chen10-May-06 6:39
Maxwell Chen10-May-06 6:39 
GeneralRe: query on Database support Pin
swapna_signsin10-May-06 23:56
swapna_signsin10-May-06 23:56 
AnswerRe: query on Database support Pin
voorugonda prashanth10-May-06 18:35
voorugonda prashanth10-May-06 18:35 
QuestionRe: query on Database support Pin
David Crow11-May-06 2:35
David Crow11-May-06 2:35 
AnswerRe: query on Database support Pin
swapna_signsin11-May-06 3:41
swapna_signsin11-May-06 3:41 
GeneralRe: query on Database support Pin
David Crow11-May-06 3:49
David Crow11-May-06 3:49 
GeneralRe: query on Database support Pin
swapna_signsin11-May-06 4:21
swapna_signsin11-May-06 4:21 
Hi,
Here I send the code written.This works in main dlgbox(dlg1),but displys empty boxes in dlg2 dlgbox.

//This is used for connection//

void CClientsDlg::CreateConnection(CString czDBPath)
{
_glbDB.sDriver ="MICROSOFT ACCESS DRIVER (*.mdb)";
_glbDB.sFile = czDBPath;
_glbDB.sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",_glbDB.sDriver,_glbDB.sFile);
_glbDB.database.Open(NULL,false,false,_glbDB.sDsn);
}

//method to retrieve data dynamically from a database
void CClientsDlg::LoadProjects()
{
CString czProjName;
CString lProjID;
CString SqlString;

CRecordset recset( &_glbDB.database);
// Build the SQL statement

SqlString = "SELECT * from tbl_Project order by ProjectName";
recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);
m_cboProject.ResetContent();
while( !recset.IsEOF() )
{
// Copy each column into a variable
recset.GetFieldValue("ProjectID",lProjID);
recset.GetFieldValue("ProjectName",czProjName);

// Insert values into the list control
m_cboProject.SetItemData(m_cboProject.AddString(czProjName),atol(lProjID));
// goto next record
recset.MoveNext();
}
// Close the database
recset.Close();
}

swapna_signsin
GeneralRe: query on Database support Pin
David Crow11-May-06 4:35
David Crow11-May-06 4:35 
GeneralRe: query on Database support Pin
swapna_signsin11-May-06 4:58
swapna_signsin11-May-06 4:58 
GeneralRe: query on Database support Pin
David Crow11-May-06 6:31
David Crow11-May-06 6:31 

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.