Hi guys, I am using an Access database in my application. The problem arises then when I try to update or edit a field corresponding to another field in the data base. Consider the database contains 2 fields,namely m_NameE2 and m_NameB2. Now I try searching out the m_NameE2 field for a given text,if found then I go for updating the corresponding m_NameB2 field.But it gives like such errors "CRecordset is read-only"-when I use rs.Edit(),or "Attempt to Update or delete failed" for rs.Update(); I use the following code: CString ss,gg; int present=0; GetDlgItemText(IDC_EDIT1,ss); gg=m_gedit.Get_Text(); if(ss!="" && gg!="") { CDatabase db; db.OpenEx(_T("DSN=ForeignName"),CDatabase::noOdbcDialog); if(db.CanUpdate()==TRUE) { CNameRecords rs(&db); rs.Open(CRecordset::dynaset); rs.MoveFirst(); do { if(rs.m_NameE2==ss) { present=1; AfxMessageBox("Data found and will be tried for modifying"); break; } rs.MoveNext(); }while(rs.IsEOF()!=TRUE); if(present==0) { AfxMessageBox("Data not found in English Name column !!"); } else { rs.Edit(); rs.m_NameB2=gg; rs.Update(); SetDlgItemText(IDC_EDIT2,rs.m_Sex2); SetDlgItemText(IDC_EDIT3,rs.m_Origin2); AfxMessageBox("Data is saved successfully"); } rs.Close(); //AfxMessageBox("Data is present in database,enter a new one"); //m_save.EnableWindow(FALSE); } else AfxMessageBox("Data is not saved,because data can't be appended in database file !!!!... "); db.Close(); } else { AfxMessageBox("Data is not saved,because the fields are partially or not filled at all !!!!... "); //m_save.EnableWindow(FALSE); }
Please help...
joy007
Posts
-
Updating a field in Access database -
Audio Frequency OutputHi guys, I have to make a dialog based application in VC++,in which I need to output some audio frequencies through the speaker system as I did in C by simply calling "sound(frequency)" from dos.h. Here also I need the same thing in the environment of VC++,i.e., the audio frequency may be supplied at runtime or statically given at compile time. I need the analogous of the following in VC++, which I found in C within dos.h. C------------------------------ VC++ sound(unsigned)--------- ? delay(unsigned)--------- ? nosound()--------------- ? Can any one of you help me?:rolleyes:
-
HELP ME to open up TASK MANAGERHi guyz, What has occurred in my system today is the nuisance that I whenever hit the Ctrl+Alt+Del from the keyboard to open up the "task manager" it reports a message box saying "Task Manager has been disabled by your Administrator",whereas I being the administrator have had done nothing such(My OS is Windows XP).That's why I can't open up the task manager anymore.For your information I have checked for viruses with Norton Antivirus.It had reported some adware threats which it was unable to delete,might they had been running background,but I also did not find them as I was unable to open the task manager.Next, I took the repair wizard from the Windows XP installation CD ,but to no avail. Now I have found an extra problem,my desktop is not working i.e.,I am unable to click the icons on the desktop. Anyone knowing even little about the solutions please let me know .:(
-
Protect my system from hackingHi, Admistrator,in my office is very much willing to hack others system.I have Windows 2000 OS installed in my system.And I am sure that he does not know my login password so that he can hack my system through "Remote Desktop connection feature".Though some how he does. Can u help giving ideas to protect my system.Atleast if I get a message when he tries to access my system will be appreciable. Help me.:sigh:
-
Saving several documentsDoes any one can help me to implement saving a single document in vc++,which in turn will save many other documents which are child to the previous.And ofcourse, the parent document will be able to be opened later on but not the child directly.On opening the parent document it should take care to open the child documents as needed to serve any specific event.:(
-
Double right click;)Any one can show me step wise how to implement a double right click on a specified item in vc++(in single document MFC application).
-
Several child documents:rolleyes: Hi,I have made a single document MFC application in VC++, in which several items may be drawn using toolbar(same as MS paint).But the problem is here: I want to make one of the items in such a way that when a user draws (selecting from toolbar)it in drawable area and clicks or double clicks (preferrable if double right click is implemented)on it, another document opens in which the user can also draw using the toolbar as it occurs for the root document.Here also if the specified tool is selected from toolbar and drawn in the child document (i.e. drawable area ) and double right clicked it opens another child document of it and so on.. Again ,if saved ,all the documents (i.e. main document,child document,next child document,...) must be saved and when opened the main document ,it should take care of the rest i.e. when double right clicked on the specified item which was drawn,the corresponding child document should be opened from repository and so on.. There may be several such item drawn in a single document.Is it possible not to open the child documents from repository? How could I do the above? Please help me step by step.
-
Several dialog boxesjoy007 wrote: Is it possible to open up dialogboxes as many numbers as an user wishes and specifies at run time? If possible then how? Ravi,I mean to say,that when an user draws an item in a document and next double clicks on the drawn item leading to open up a dialog box or another document which may or may not contain the same item drawn.If same item is found drawn on this new document and double clicked it should open up another dialog box or document and so on.... Actually I want the to make the item as multilevel so that an user can go through easily from its root level to node.
-
Several dialog boxesIs it possible to open up dialogboxes as many numbers as an user wishes and specifies at run time? If possible then how? How can I make a bitmap resource clickable so that a new dialog box appears when it is clicked ,in which there may contain the same bitmap resource along with the upper said clickable criterion???:^)
-
Steps to make a clickable area drawn by a user at run timeActually, I am going to make an MFC application in which an user can draw a DFD(Data Flow Diagram).Practically it will be analogous to a normal "paint" program.But the difference is that ,it will consist of a circle tool ,to draw a process,which must be clickable so that if the process is multilevel,it can show up the inner DFD of the concerned process when clicked,in a child dialog. Would please let me know the steps in VC++!! My another problem is how can I implement a tool(same as TEXT button tool in MS PAINT) which can be used to put down a text at runtime in the user's pointed location within user's drawable area?:(
-
Connecting databaseRecently I gone through a project in which I used a ".mdb" database.But whenever I took the application in different systems,I had to connect,once, the certain database manually by clicking "ODBC data sources Administrator" in control panel and choosing the right path. I think it is not suitable for the users ,actually when the application is distributed,to do the right steps in connecting the database. So,is it possible to code it within the project so that it automatically connects to its required database at the time of initialisation of the application for the first time?
-
Drawing buttonIs it possible to let a user draw his own button at runtime? I mean to say,that the button size be varied with its position also at runtime. Actually,my project work needs to make a toolbar analogous to "Micrsoft Paint"'s toolbar in which there will be button tool which a user can use to make a button in his workplace.It will be more suitable if the button is circular rather than rectangular as seen normally in VC++ .
-
Invoking a .exe into VC++In which class does it belong to? Actually , I am a newB in VC++.:confused:
-
Invoking a .exe into VC++Is it possible to invoke a .exe file into the code of VC++? If possible then how is it done?:-D
-
Invoking java in VC++Is it possible to invoke any class written in java within VC++? I know, the vice versa is possible by "native " keyword and compiling with javah.exe and so on...:rolleyes:
-
Algorithm and necessary codeWould you please let me know some concepts ,algorithms or codes regarding to the translation from a regional language(i.e.,Bengali) to English.Its may be a part of transliteration also.Particularly, it is needy to identify proper nouns from a given sentence or statement.How would I implement this?I approached to search a database (say,some.mdb)having names of persons in ISCII format .But it may become time consuming!! Let it be identified, then is it possible to translate without searching database? Help me.......:((
-
How to Enable at runtime:confused:How to make a disabled button enabled at runtime by pressing a certain button
-
How to exit an application by hitting an exit buttonI 've created a single document database application in VC++.The problem is that I can not make out how to make an "exit" button which when hit will close the application immediately(i.e,MainFrame will be closed).