Click here to Skip to main content
15,908,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DLL crashing Pin
tansey429-Jan-06 15:33
tansey429-Jan-06 15:33 
GeneralRe: DLL crashing Pin
Stephen Hewitt29-Jan-06 15:38
Stephen Hewitt29-Jan-06 15:38 
AnswerRe: DLL crashing Pin
Prakash Nadar29-Jan-06 17:46
Prakash Nadar29-Jan-06 17:46 
General[Message Deleted] Pin
Laxman929-Jan-06 18:00
Laxman929-Jan-06 18:00 
GeneralRe: DLL crashing Pin
Prakash Nadar29-Jan-06 18:18
Prakash Nadar29-Jan-06 18:18 
GeneralRe: DLL crashing Pin
Owner drawn29-Jan-06 18:35
Owner drawn29-Jan-06 18:35 
AnswerRe: DLL crashing Pin
Laxman929-Jan-06 18:31
Laxman929-Jan-06 18:31 
QuestionF1 help annoyance Pin
Uakari29-Jan-06 3:47
Uakari29-Jan-06 3:47 
AnswerRe: F1 help annoyance Pin
Owner drawn29-Jan-06 17:03
Owner drawn29-Jan-06 17:03 
QuestionRe: F1 help annoyance Pin
Uakari29-Jan-06 22:56
Uakari29-Jan-06 22:56 
AnswerRe: F1 help annoyance Pin
Owner drawn29-Jan-06 22:58
Owner drawn29-Jan-06 22:58 
GeneralRe: F1 help annoyance Pin
Uakari29-Jan-06 23:16
Uakari29-Jan-06 23:16 
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 

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.