|
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. A JOIN 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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
hi
i have a task to implement VoIP but i dont have any idea about it ... i have read some tutorials about VoIP and got some basic idea... but i dont have any clue how to implement it in vc++.... is there anybody who can help me in this problem ...
ill be gratreful
regards
ali hammad
|
|
|
|
|
hi
i have a task to implement VoIP but i dont have any idea about it ... i have read some tutorials about VoIP and got some basic idea... but i dont have any clue how to implement it in vc++.... is there anybody who can help me in this problem ...
ill be gratreful
regards
ali hammad
|
|
|
|
|
What exactly is your requirement ..?
Dharani Babu S
|
|
|
|
|
how to use flash in vc++.
|
|
|
|
|
const UINT msgID = RegisterWindowMessage("SomeString");
.
.
.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case msgID:
// do something
}
}
after compile, the error is :
error C2051: case expression not constant
why?
thanks
|
|
|
|
|
Hello ting668,
C/C++ compilers require the switch/case statements to use constant literals or macros (that work out to actual literal values).
A statement like the following :
case msgID:
is no good to the compiler because the compiler does not know what "msgID" is during compilation.
Regards,
Bio.
|
|
|
|
|
Because the value of msgID is not known at compile time, it is generated at run time, and the compiler must know the value of any constant used in case statements. You have to use an if else construct for registered messages.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
i think ,you go for if statement for resolving Registered message id before Switch statement
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ting668 wrote:
why?
Case expressions must be integral constants.
"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 anybody tell me abt how to find vendor of a scsi hard disk using c++ ?
As SCSI command: READ_CAPACITY does not give u this information
Thanks & Regards
|
|
|
|
|
Anonymous wrote:
Hi, can anybody tell me abt how to find vendor of a scsi hard disk using c++ ?
The vendor's name is typically not part of a piece of hardware. Are you perhaps referring to the manufacturer's name (e.g., Seagate, WD, Hitachi)?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello all.
I am creating a CRichEditCtrl derived class, and I want it to be always a read-only edit box.
I guess I should use somewhere the SetReadOnly() function but, which method should I overwrite?.
I have created a Dialog with a CEdit, I've used the class wizard to add a control variable for the CEdit, and I've writen my clase name instead the CEdit one (the usual procedure, I think).
I've tried to overwrite several functions, like OnCreate, but they are never called (I'm sorry about my ignorance
Thanks in advance.
|
|
|
|
|
cbusgut wrote:
I guess I should use somewhere the SetReadOnly() function but, which method should I overwrite?.
Have you tried PreSubclassWindow() ?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thank you very much. That was what I was looking for!
|
|
|
|
|
Hai Frens
I am facing a prblm with modeless dialog.
I am taking the parent for child dialog as desktop passing GetDesktopWindow() function in Create() func of dialog. Now the prblm is once i close the child, the parent is not getting enabled automatically. Only if i click it will get enabled.
What i want is the parent should get enabled automatically if i close the child. . .
Could any body help me to get it out this prblm. . .
thanx
bye
|
|
|
|
|
on WM_DESTROY of your modeless dialog set the focus to the desktop window...
Hope this helps you,
Greetz,
Davy
|
|
|
|
|
My application is a SDI and i am invoking the modeless dialog from the menu item click. Once i close the dialog the SDI should get enaled. Which function i have to use set the focus for desktop window. . .weather i have to set focus for SDI or desktop?
Thanx
|
|
|
|
|
uueeMy application is a SDI and i am invoking the modeless dialog from the menu item click. Once i close the dialog the SDI should get enaled. Which function i have to use set the focus for desktop window. . .weather i have to set focus for SDI or desktop?
Thanx
|
|
|
|
|
I think this should set the focus to the main window of your app...
::SetFocus(AfxGetMainWnd()->m_hWnd);
Greetz,
Davy
|
|
|
|