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

C / C++ / MFC

 
GeneralCComboBox Pin
mstanciu200017-Sep-03 2:52
mstanciu200017-Sep-03 2:52 
GeneralRe: CComboBox Pin
David Crow17-Sep-03 3:19
David Crow17-Sep-03 3:19 
GeneralRe: CComboBox Pin
mstanciu200017-Sep-03 20:20
mstanciu200017-Sep-03 20:20 
GeneralRe: CComboBox Pin
Steve S18-Sep-03 1:55
Steve S18-Sep-03 1:55 
GeneralRe: CComboBox Pin
Yonatan10-Nov-03 1:54
Yonatan10-Nov-03 1:54 
GeneralRe: CComboBox Pin
Anonymous10-Nov-03 2:26
Anonymous10-Nov-03 2:26 
GeneralRe: CComboBox Pin
Yonatan10-Nov-03 2:59
Yonatan10-Nov-03 2:59 
Questionhow to display access database into dialog? Pin
coda_x17-Sep-03 2:13
coda_x17-Sep-03 2:13 
i used the following and got stuck after the recset.GetFieldValue("Address ID",sID);
recset.GetFieldValue("Last Name",sLastname);

coz nt sure how to make my edit box display the data of Address ID and Last name.

the code goes:

void CAccessdbDlg::OnButton2()
{
CDatabase database;
CString SqlString;
CString sID, sLastname;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString sFile = "e:\\fyp_2003\\database_sample.mdb";

// Build ODBC connection string
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);

TRY

{
// Open the database
database.Open(NULL,false,false,sDsn);

// Allocate the recordset
CRecordset recset( &database );

// Build the SQL statement
SqlString = "SELECT Address ID, Last Name "
"FROM Categories";

// Execute the query
recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);


// Copy each column into a variable
recset.GetFieldValue("Address ID",sID);
recset.GetFieldValue("Last Name",sLastname);

????????????
database.Close();
}
CATCH(CDBException, e)
{
// If a database exception occured, show error msg
AfxMessageBox("Database error: "+e->m_strError);
}
END_CATCH;

}

and is this code correct?Hmmm | :|
AnswerRe: how to display access database into dialog? Pin
David Crow17-Sep-03 2:39
David Crow17-Sep-03 2:39 
GeneralRe: how to display access database into dialog? Pin
coda_x17-Sep-03 3:22
coda_x17-Sep-03 3:22 
GeneralRe: how to display access database into dialog? Pin
David Crow17-Sep-03 3:32
David Crow17-Sep-03 3:32 
GeneralRe: how to display access database into dialog? Pin
coda_x17-Sep-03 3:33
coda_x17-Sep-03 3:33 
GeneralRe: how to display access database into dialog? Pin
David Crow17-Sep-03 5:32
David Crow17-Sep-03 5:32 
GeneralChanging Version Info in EXE Files Pin
Steve Thresher17-Sep-03 1:58
Steve Thresher17-Sep-03 1:58 
GeneralRe: Changing Version Info in EXE Files Pin
Jagadeesh VN17-Sep-03 2:12
Jagadeesh VN17-Sep-03 2:12 
GeneralRe: Changing Version Info in EXE Files Pin
Steve Thresher17-Sep-03 2:56
Steve Thresher17-Sep-03 2:56 
GeneralRe: Changing Version Info in EXE Files Pin
Jagadeesh VN17-Sep-03 3:04
Jagadeesh VN17-Sep-03 3:04 
GeneralRe: Changing Version Info in EXE Files Pin
Steve Thresher17-Sep-03 4:40
Steve Thresher17-Sep-03 4:40 
GeneralRe: Changing Version Info in EXE Files Pin
FearlessBurner17-Sep-03 3:46
FearlessBurner17-Sep-03 3:46 
GeneralDelete a complete folder Pin
peterchen17-Sep-03 1:50
peterchen17-Sep-03 1:50 
GeneralRe: Delete a complete folder Pin
Jagadeesh VN17-Sep-03 2:37
Jagadeesh VN17-Sep-03 2:37 
GeneralRe: Delete a complete folder Pin
David Crow17-Sep-03 2:41
David Crow17-Sep-03 2:41 
GeneralUse .net WebService from a Visual C++ 6.0 Application Pin
Braulio Dez17-Sep-03 1:01
Braulio Dez17-Sep-03 1:01 
QuestionSetWindowLong using a class member function? Pin
Harco17-Sep-03 0:59
Harco17-Sep-03 0:59 
AnswerRe: SetWindowLong using a class member function? Pin
Jagadeesh VN17-Sep-03 1:21
Jagadeesh VN17-Sep-03 1:21 

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.