Dialog Window supporting Database ???
-
Hi.... I wanted to know whether we can create a dialog based Appliocation having document/view support, indirectly saying to have databse support in a dialog base application. After entering the application wizard, in the second step it asks for the type of application to be built. if we go for SDI or MDI we can choose the document/view option and then canchoose our data source. But if we choose the dialog based application, then the option for choosing the data source is no more available. Now how to give this dialog based application the database connectivity ??????? And further more if we are calling further more dialogs from the first dialog window then the connectivity should be there for all the windows. Anyone..... Pankaj
-
Hi.... I wanted to know whether we can create a dialog based Appliocation having document/view support, indirectly saying to have databse support in a dialog base application. After entering the application wizard, in the second step it asks for the type of application to be built. if we go for SDI or MDI we can choose the document/view option and then canchoose our data source. But if we choose the dialog based application, then the option for choosing the data source is no more available. Now how to give this dialog based application the database connectivity ??????? And further more if we are calling further more dialogs from the first dialog window then the connectivity should be there for all the windows. Anyone..... Pankaj
Hi, Create a Dialogbased application, Add a new class to it using classwizard. Choose the base class 4 the newclass as CRecordSet, it will ask 4 the other db informations Sujan
-
Hi, Create a Dialogbased application, Add a new class to it using classwizard. Choose the base class 4 the newclass as CRecordSet, it will ask 4 the other db informations Sujan
Tha is okay....but when it comes to attaching the member variables with the fields of the database, then the CRecordView class is required. I stuck up here when i have to attach the member variables. Please help in this matter then i suppose it will work successfully !!! Do reply.... Pankaj
-
Tha is okay....but when it comes to attaching the member variables with the fields of the database, then the CRecordView class is required. I stuck up here when i have to attach the member variables. Please help in this matter then i suppose it will work successfully !!! Do reply.... Pankaj
Hi, while adding the Class itself, it will ask for the name of the datasource/db. When you give it, it will automatically add the fields to the newly created class, which is derived from CRecordSet. Where R U getting the CRecordView ???. Sujan
-
Hi, while adding the Class itself, it will ask for the name of the datasource/db. When you give it, it will automatically add the fields to the newly created class, which is derived from CRecordSet. Where R U getting the CRecordView ???. Sujan
My Friend... I have done what all you said. I made my own class which had the base class as CRecordSet. It asked for the details of the database and everything else. It created the class in which all the field members of the database were accesed by a global variable m_pSet, for eg. m_pSet -> Name where Name is a field of the database. Now i have, say a edit box on my dialog resource, and i want to display the Name field in it. I will go to the class Wizard and Member Variable Tab. there i will have to assign the variable of this edit box, say IDC_NAME = m_pSet -> Name Now since there is no CRecordView class, so this cannot happen, which in the normal cases of SDI or MDI which have CRecordView as the base class give the option to assign these variables. My problem lies here that how to assign any resource variable to the field variable as i said above. Please do let me know how this can happen.... Pankaj
-
My Friend... I have done what all you said. I made my own class which had the base class as CRecordSet. It asked for the details of the database and everything else. It created the class in which all the field members of the database were accesed by a global variable m_pSet, for eg. m_pSet -> Name where Name is a field of the database. Now i have, say a edit box on my dialog resource, and i want to display the Name field in it. I will go to the class Wizard and Member Variable Tab. there i will have to assign the variable of this edit box, say IDC_NAME = m_pSet -> Name Now since there is no CRecordView class, so this cannot happen, which in the normal cases of SDI or MDI which have CRecordView as the base class give the option to assign these variables. My problem lies here that how to assign any resource variable to the field variable as i said above. Please do let me know how this can happen.... Pankaj
Oh 4 that, you must have to add a member variable to the edit control say m_myname, and you must have to passon the value m_pSet->Name into this and must have to call updateData function m_myname = m_pSet->Name UpdateData(FALSE); The best way is to write a function say getvalues(), which gets all the values from the recordset and displays it on the dialog. I do think there is another way to bind direclty is there, but couldn't remember it. Just go throught the MSDN. Usually what i'll do is i'll write my own class 4 data manipulation Sujan
-
Oh 4 that, you must have to add a member variable to the edit control say m_myname, and you must have to passon the value m_pSet->Name into this and must have to call updateData function m_myname = m_pSet->Name UpdateData(FALSE); The best way is to write a function say getvalues(), which gets all the values from the recordset and displays it on the dialog. I do think there is another way to bind direclty is there, but couldn't remember it. Just go throught the MSDN. Usually what i'll do is i'll write my own class 4 data manipulation Sujan
Thanks....this is one method that did not strike me....this can be done and i am sure it will work. But usually what happens is that in the class wizard we get a combo box in which all the member variables are stored by default, we just have to choose for which resource which field variable we have to assign. In this case no coding is required. But as you said i think by coding in this manner, the work will be done. Anyways, Thanks a lot !!! Regards, Pankaj