SDI Application - Multiple Tables
-
Hi friends.... I am working on a SDI application with database support. I require two tables for my application. While configuring the application wizard i specified both the tables in the Data Source when asked. Everything went fine. The application is running well. But if i want to add a new record in a table then it does not allow and states that "Database is Read Only". I went again making the same appliaction with a single table, and when i tried to add a new record it did successfully. Why is it happening that when using two tables the database is openeing as Read Only. I am not using Open function at all, since the application wizard itself opens it up. It happens fine when i use one table. It should do with two tables too. Please solve this problem of mine. Thanks. Pankaj
-
Hi friends.... I am working on a SDI application with database support. I require two tables for my application. While configuring the application wizard i specified both the tables in the Data Source when asked. Everything went fine. The application is running well. But if i want to add a new record in a table then it does not allow and states that "Database is Read Only". I went again making the same appliaction with a single table, and when i tried to add a new record it did successfully. Why is it happening that when using two tables the database is openeing as Read Only. I am not using Open function at all, since the application wizard itself opens it up. It happens fine when i use one table. It should do with two tables too. Please solve this problem of mine. Thanks. Pankaj
Pankaj_Agarwal wrote: Why is it happening that when using two tables the database is openeing as Read Only. The query that was created no doubt has a
JOIN
in it. AJOIN
ed query cannot be updated. You'll need to update each table separately.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
Pankaj_Agarwal wrote: Why is it happening that when using two tables the database is openeing as Read Only. The query that was created no doubt has a
JOIN
in it. AJOIN
ed query cannot be updated. You'll need to update each table separately.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
Hi, Can you please let me know how to perform this task. Or please let me know that how to use two or more tables in a SDI application so that at any place or time any table can be updated. Please do help meout !!!! Pankaj
-
Hi, Can you please let me know how to perform this task. Or please let me know that how to use two or more tables in a SDI application so that at any place or time any table can be updated. Please do help meout !!!! Pankaj
Like I said, you'll need to update each table separately. For example, if table A had customer information in it and table B had order information in it, you would first add a new row to table A, then you would add a new row to table B. They would be "tied" together via the primary/foreign key.
--------------- ---------------
| Table A | | Table B |
| Primary Key |------| Foreign Key |
| Name | | Part # |
| Address | | Quantity |
| Phone | | |
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
Like I said, you'll need to update each table separately. For example, if table A had customer information in it and table B had order information in it, you would first add a new row to table A, then you would add a new row to table B. They would be "tied" together via the primary/foreign key.
--------------- ---------------
| Table A | | Table B |
| Primary Key |------| Foreign Key |
| Name | | Part # |
| Address | | Quantity |
| Phone | | |
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
Hi, Dear, this is the problem...my two tables are not related to each other. Actually one table has the header of the company which i am displaying on the top and the other table has all the details which has to be displayed, edited and add on the window. Both the tables have no relation at all with one another. In such a case what to do. And also if the tables have realtion as Primary Key- forign Key then as you said to update each table separately, in that case alsoboth the table firlds are being displayed on the window, and after a execute the AddNew (), it shows the error that the "Database is read only"... Please look into it. Thanks, Pankaj
-
Hi, Dear, this is the problem...my two tables are not related to each other. Actually one table has the header of the company which i am displaying on the top and the other table has all the details which has to be displayed, edited and add on the window. Both the tables have no relation at all with one another. In such a case what to do. And also if the tables have realtion as Primary Key- forign Key then as you said to update each table separately, in that case alsoboth the table firlds are being displayed on the window, and after a execute the AddNew (), it shows the error that the "Database is read only"... Please look into it. Thanks, Pankaj
Pankaj_Agarwal wrote: Both the tables have no relation at all with one another. In such a case what to do. Start over. When AppWizard asks you for the table, only specify one of them, then create the other using ClassWizard. Or, create the application with no database support, then use ClassWizard to create two classes derived from
CRecordset
.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow