Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: A button accepts files Pin
Naveen8-Oct-08 18:59
Naveen8-Oct-08 18:59 
Question_set_new_handler Pin
dharani8-Oct-08 17:56
dharani8-Oct-08 17:56 
AnswerRe: _set_new_handler Pin
Jijo.Raj8-Oct-08 18:17
Jijo.Raj8-Oct-08 18:17 
QuestionHelp With A Program. I Dont Know Where To Begin. PLZ HELP ME Pin
LilKoopa8-Oct-08 9:26
LilKoopa8-Oct-08 9:26 
AnswerRe: Help With A Program. I Dont Know Where To Begin. PLZ HELP ME Pin
CPallini8-Oct-08 9:32
mveCPallini8-Oct-08 9:32 
GeneralRe: Help With A Program. I Dont Know Where To Begin. PLZ HELP ME Pin
Perspx8-Oct-08 9:44
Perspx8-Oct-08 9:44 
AnswerRe: Help With A Program. I Dont Know Where To Begin. PLZ HELP ME Pin
David Crow8-Oct-08 10:01
David Crow8-Oct-08 10:01 
QuestionUnable to set QueryTimeout on CDatabase* Pin
spongetodd8-Oct-08 5:19
spongetodd8-Oct-08 5:19 
I have inherited someone else's c++ code that I need to increase the QueryTimeout value for, and I have run into a snag. They defined the recordset using this syntax:

From the .h file:

class test : public CRecordset
{
public:
test(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(test)
//{{AFX_FIELD(test, CRecordset)
...
//}}AFX_FIELD

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(test)
public:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // Default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//}}AFX_VIRTUAL
}


From the .cpp file:

IMPLEMENT_DYNAMIC(test, CRecordset)

test::test(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(test)
...
//}}AFX_FIELD_INIT

m_nDefaultType = snapshot;
}

Eventually the query get's called using:

test m_test(NULL);
m_test.m_strFilter="Select Field1, Field2 from Table";
m_test.Open();


I've tried several methods to change the QueryTimeout value, all with no success. To make this work, I think I need to separate the indirect reference to CDatabase* pdb so that I can modify the settings for pdb. I've not been able to find any examples anywhere that discuss how this could be done differently without re-writing major portions of the program.

Can anyone please confirm if I'm on the right track, and if possible, what the code should look like to accomplish this?

Thanks,
SpT
AnswerRe: Unable to set QueryTimeout on CDatabase* Pin
Mark Salsbery8-Oct-08 6:53
Mark Salsbery8-Oct-08 6:53 
GeneralRe: Unable to set QueryTimeout on CDatabase* Pin
spongetodd8-Oct-08 7:05
spongetodd8-Oct-08 7:05 
GeneralRe: Unable to set QueryTimeout on CDatabase* Pin
led mike8-Oct-08 10:15
led mike8-Oct-08 10:15 
GeneralRe: Unable to set QueryTimeout on CDatabase* Pin
Mark Salsbery8-Oct-08 10:28
Mark Salsbery8-Oct-08 10:28 
GeneralRe: Unable to set QueryTimeout on CDatabase* Pin
Mark Salsbery8-Oct-08 10:29
Mark Salsbery8-Oct-08 10:29 
GeneralRe: Unable to set QueryTimeout on CDatabase* Pin
led mike8-Oct-08 10:37
led mike8-Oct-08 10:37 
QuestionC++: Connectin string to MS SQL 2005? Pin
Gofur Halmurat8-Oct-08 3:57
Gofur Halmurat8-Oct-08 3:57 
AnswerRe: C++: Connectin string to MS SQL 2005? Pin
led mike8-Oct-08 4:36
led mike8-Oct-08 4:36 
AnswerRe: C++: Connectin string to MS SQL 2005? Pin
Mark Salsbery8-Oct-08 4:56
Mark Salsbery8-Oct-08 4:56 
QuestionDisabling the root node in a tree control in MFC Pin
SanjaySMK8-Oct-08 3:26
SanjaySMK8-Oct-08 3:26 
QuestionRe: Disabling the root node in a tree control in MFC Pin
led mike8-Oct-08 4:32
led mike8-Oct-08 4:32 
AnswerRe: Disabling the root node in a tree control in MFC Pin
Maximilien8-Oct-08 8:15
Maximilien8-Oct-08 8:15 
QuestionHiding Application from taskbar.. Pin
gothic_coder8-Oct-08 2:55
gothic_coder8-Oct-08 2:55 
AnswerRe: Hiding Application from taskbar.. Pin
gothic_coder8-Oct-08 3:04
gothic_coder8-Oct-08 3:04 
AnswerRe: Hiding Application from taskbar.. Pin
Nibu babu thomas8-Oct-08 3:24
Nibu babu thomas8-Oct-08 3:24 
AnswerRe: Hiding Application from taskbar.. Pin
David Crow8-Oct-08 3:25
David Crow8-Oct-08 3:25 
GeneralRe: Hiding Application from taskbar.. Pin
gothic_coder8-Oct-08 3:50
gothic_coder8-Oct-08 3:50 

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.