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

C / C++ / MFC

 
GeneralRe: F1 help annoyance Pin
Owner drawn29-Jan-06 23:31
Owner drawn29-Jan-06 23:31 
GeneralRe: F1 help annoyance Pin
Uakari30-Jan-06 1:51
Uakari30-Jan-06 1:51 
GeneralRe: F1 help annoyance Pin
Owner drawn30-Jan-06 16:54
Owner drawn30-Jan-06 16:54 
QuestionDatabase conversion using C++ Pin
SWDevil29-Jan-06 1:49
SWDevil29-Jan-06 1:49 
AnswerRe: Database conversion using C++ Pin
Eytukan29-Jan-06 3:01
Eytukan29-Jan-06 3:01 
GeneralRe: Database conversion using C++ Pin
SWDevil30-Jan-06 4:51
SWDevil30-Jan-06 4:51 
GeneralRe: Database conversion using C++ Pin
Eytukan30-Jan-06 5:28
Eytukan30-Jan-06 5:28 
GeneralRe: Database conversion using C++ Pin
SWDevil5-Feb-06 2:22
SWDevil5-Feb-06 2:22 
I wrote the following code:

CDatabase srcDb;
if (srcDb.Open(NULL))
{
m_sDbName = srcDb.GetConnect(); //m_sDbName is a variable of type CString
UpdateData(FALSE);
}

CRecordset rs(&srcDb);
CString strSQL;
strSQL = "SELECT * FROM table1";

rs.Open(CRecordset::snapshot, strSQL, CRecordset::readOnly);
rs.Close();


Everything works OK, (the database is connected), but when it gets to the row:
rs.Open(CRecordset::snapshot, strSQL, CRecordset::readOnly);
the application crashes, and I don't understand why...

Is this the right syntax for connecting to a database and retrieving data from a table? Could you maybe attach some source code, so I could compare?

Another question - after the row: rs.Open(CRecordset::snapshot, strSQL, CRecordset::readOnly); executes I should have the data from the table in the recordset object, right?





QuestionLayout in MFC Pin
Member 47509029-Jan-06 1:35
Member 47509029-Jan-06 1:35 
AnswerRe: Layout in MFC Pin
spiritofklanawa29-Jan-06 9:36
spiritofklanawa29-Jan-06 9:36 
Questionhow can i convert lower case into uppercase Pin
sheshidar29-Jan-06 0:08
sheshidar29-Jan-06 0:08 
AnswerRe: how can i convert lower case into uppercase Pin
Danish jibbran29-Jan-06 1:16
Danish jibbran29-Jan-06 1:16 
AnswerRe: how can i convert lower case into uppercase Pin
Eytukan29-Jan-06 7:57
Eytukan29-Jan-06 7:57 
GeneralRe: how can i convert lower case into uppercase Pin
zoz30-Jan-06 10:37
zoz30-Jan-06 10:37 
QuestionRetreiving Parent of a child in a Tree Pin
kandukuri28-Jan-06 22:16
kandukuri28-Jan-06 22:16 
AnswerRe: Retreiving Parent of a child in a Tree Pin
Danish jibbran29-Jan-06 1:22
Danish jibbran29-Jan-06 1:22 
QuestionDatabase Question Pin
BlitzPackage28-Jan-06 21:37
BlitzPackage28-Jan-06 21:37 
AnswerRe: Database Question Pin
PJ Arends29-Jan-06 11:14
professionalPJ Arends29-Jan-06 11:14 
GeneralRe: Database Question Pin
BlitzPackage30-Jan-06 4:56
BlitzPackage30-Jan-06 4:56 
QuestionHow to give event on costom control class Pin
CadNepalSDK28-Jan-06 21:06
CadNepalSDK28-Jan-06 21:06 
AnswerRe: How to give event on costom control class Pin
Prakash Nadar29-Jan-06 17:47
Prakash Nadar29-Jan-06 17:47 
GeneralRe: How to give event on costom control class Pin
CadNepalSDK29-Jan-06 20:17
CadNepalSDK29-Jan-06 20:17 
AnswerRe: How to give event on costom control class Pin
Prakash Nadar29-Jan-06 20:21
Prakash Nadar29-Jan-06 20:21 
GeneralRe: How to give event on costom control class Pin
CadNepalSDK29-Jan-06 23:48
CadNepalSDK29-Jan-06 23:48 
GeneralRe: How to give event on costom control class Pin
Prakash Nadar29-Jan-06 23:54
Prakash Nadar29-Jan-06 23:54 

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.