How to update database using values in textboxes
-
Hello, Can anyone help me to update the database using the values in textboxes. I have successfully written code to add new rows and to delete rows in the database by checking the values in the textboxes on the form. But my problem is that I am unable to update the database similarly. I have created a table in MS-Access named "emp" containing two fields named "name" and "phone" with phone as primary key. On the form I have made two textboxes with their DataBinding text property set for name and phone fields respectively of the dataset. Also I have made a button to load the dataset. And yet another button on which I want to code for updating the database. I have tried many codes but none of them works, when I load the dataset and then make some changes in the text of the textboxes and then click on the update button the respctive database is not updated. If anyone has answer to this problem please inform me with code, this is very urgent and I m facing this problem for many days .
-
Hello, Can anyone help me to update the database using the values in textboxes. I have successfully written code to add new rows and to delete rows in the database by checking the values in the textboxes on the form. But my problem is that I am unable to update the database similarly. I have created a table in MS-Access named "emp" containing two fields named "name" and "phone" with phone as primary key. On the form I have made two textboxes with their DataBinding text property set for name and phone fields respectively of the dataset. Also I have made a button to load the dataset. And yet another button on which I want to code for updating the database. I have tried many codes but none of them works, when I load the dataset and then make some changes in the text of the textboxes and then click on the update button the respctive database is not updated. If anyone has answer to this problem please inform me with code, this is very urgent and I m facing this problem for many days .
-
Hello, Can anyone help me to update the database using the values in textboxes. I have successfully written code to add new rows and to delete rows in the database by checking the values in the textboxes on the form. But my problem is that I am unable to update the database similarly. I have created a table in MS-Access named "emp" containing two fields named "name" and "phone" with phone as primary key. On the form I have made two textboxes with their DataBinding text property set for name and phone fields respectively of the dataset. Also I have made a button to load the dataset. And yet another button on which I want to code for updating the database. I have tried many codes but none of them works, when I load the dataset and then make some changes in the text of the textboxes and then click on the update button the respctive database is not updated. If anyone has answer to this problem please inform me with code, this is very urgent and I m facing this problem for many days .
Hi!Mohit Namdeo. All steps right but not enough. When you input on textboxs then datas only update on dataset no update on database. so you must do that. here code on button update be sure the connection,dataset,oledb...are created. private sub update_click(...) { oledb.update(dataset) } end sub good luck:rolleyes: