Click here to Skip to main content
15,910,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalconvert .net project to vs6 project Pin
sstoyan24-Jan-04 3:28
sstoyan24-Jan-04 3:28 
GeneralRe: convert .net project to vs6 project Pin
Jörgen Sigvardsson24-Jan-04 5:11
Jörgen Sigvardsson24-Jan-04 5:11 
GeneralRe: convert .net project to vs6 project Pin
sstoyan25-Jan-04 1:30
sstoyan25-Jan-04 1:30 
GeneralVLDB question... Pin
Orkun GEDiK24-Jan-04 2:01
Orkun GEDiK24-Jan-04 2:01 
Generalto make a transparent image Pin
emmatty24-Jan-04 1:50
emmatty24-Jan-04 1:50 
GeneralRe: to make a transparent image Pin
Delfny26-Jan-04 8:42
Delfny26-Jan-04 8:42 
GeneralUsing theCArray class with a non trival Class Pin
magpierre24-Jan-04 1:36
magpierre24-Jan-04 1:36 
GeneralRe: Using theCArray class with a non trival Class Pin
John R. Shaw24-Jan-04 7:18
John R. Shaw24-Jan-04 7:18 
GeneralRe: Using theCArray class with a non trival Class Pin
John R. Shaw24-Jan-04 7:20
John R. Shaw24-Jan-04 7:20 
GeneralDevice Driver Programming Pin
A_Fa24-Jan-04 1:27
A_Fa24-Jan-04 1:27 
GeneralRe: Device Driver Programming Pin
Anonymous24-Jan-04 2:27
Anonymous24-Jan-04 2:27 
GeneralRe: Device Driver Programming Pin
dejones7224-Jan-04 6:38
sussdejones7224-Jan-04 6:38 
GeneralRe: Device Driver Programming Pin
wb25-Jan-04 4:39
wb25-Jan-04 4:39 
GeneralRe: Device Driver Programming Pin
toxcct25-Jan-04 23:02
toxcct25-Jan-04 23:02 
GeneralUnicode ActiveX on 98 Pin
Hesham Amin24-Jan-04 1:04
Hesham Amin24-Jan-04 1:04 
GeneralRe: Unicode ActiveX on 98 Pin
Michael Dunn24-Jan-04 6:17
sitebuilderMichael Dunn24-Jan-04 6:17 
GeneralRe: Unicode ActiveX on 98 Pin
Hesham Amin24-Jan-04 10:13
Hesham Amin24-Jan-04 10:13 
GeneralRe: Unicode ActiveX on 98 Pin
Michael Dunn24-Jan-04 20:08
sitebuilderMichael Dunn24-Jan-04 20:08 
GeneralCalling of DHTML Dialog Pin
Inam23-Jan-04 22:40
Inam23-Jan-04 22:40 
QuestionDialog dissapears... ? Pin
Calder23-Jan-04 22:34
Calder23-Jan-04 22:34 
AnswerRe: Dialog dissapears... ? Pin
Antti Keskinen23-Jan-04 22:57
Antti Keskinen23-Jan-04 22:57 
GeneralRe: Dialog dissapears... ? Pin
Calder23-Jan-04 23:33
Calder23-Jan-04 23:33 
GeneralRe: Dialog dissapears... ? Pin
Antti Keskinen23-Jan-04 23:57
Antti Keskinen23-Jan-04 23:57 
No.

You should move the AnstalldaSet member variable (your CRecordset-derived class, I assume) into the header file of your dialog, as it's member variable. This way, you can access the created object anytime.

Also, remember that you MUST move the database object in there as well. Otherwise, you create the database object, bind the recordset, create a query, and when OnInitDialog goes out of scope, the database object gets destroyed and closes itself up, making your recordset object just about useless.

It is possible to create recordset objects that get their results from the database and then save the whoke result into local variables. However, I suggest you keep the database connection constantly open when you browse the databse, no matter what the type of the recordset is. So, move both the CDatabase object and the CRecordset-derived class into the dialog's header file. Initialize and open them in OnInitDialog, then use them when the dialog is open, and close them in the destructor of the dialog.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Dialog dissapears... ? Pin
Calder24-Jan-04 4:08
Calder24-Jan-04 4:08 
GeneralRe: Dialog dissapears... ? Pin
Antti Keskinen24-Jan-04 21:22
Antti Keskinen24-Jan-04 21:22 

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.