473,395 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Update data using Connection

werks
220 100+
I have this code

Expand|Select|Wrap|Line Numbers
  1. CoNN.BeginTrans
  2. CoNN.Execute "UPDATE tblsubject SET [Subject1]='" & txtSubject1.Text & "', [Subject2]='" & txtSubject2.Text & "', [Subject3]='" & txtSubject3.Text & "', [Subject4]='" & txtSubject4.Text & "', [Subject5]='" & txtSubject5.Text & "', [Subject6]='" & txtSubject6.Text & "', [Subject7]='" & txtSubject7.Text & "', [Subject8]='" & txtSubject8.Text & "' WHERE [SubjectID]=" & v_ID & ";"
  3. CoNN.CommitTrans
  4.  
There is no problem in adding, my problem is that it doesn't update using the same code.. Do i have to use the Adodb.Recordset in updating the data?

tnx in advance..
Feb 2 '08 #1
6 1500
lotus18
866 512MB
I have this code

Expand|Select|Wrap|Line Numbers
  1. CoNN.BeginTrans
  2. CoNN.Execute "UPDATE tblsubject SET [Subject1]='" & txtSubject1.Text & "', [Subject2]='" & txtSubject2.Text & "', [Subject3]='" & txtSubject3.Text & "', [Subject4]='" & txtSubject4.Text & "', [Subject5]='" & txtSubject5.Text & "', [Subject6]='" & txtSubject6.Text & "', [Subject7]='" & txtSubject7.Text & "', [Subject8]='" & txtSubject8.Text & "' WHERE [SubjectID]=" & v_ID
  3. CoNN.CommitTrans
  4.  
There is no problem in adding, my problem is that it doesn't update using the same code.. Do i have to use the Adodb.Recordset in updating the data?

tnx in advance..
Omit & ";" at the end of your statement. I'm assuming that the Subject ID is an integer type. BTW, are you using as access as your backend?


Rey Sean
Feb 2 '08 #2
werks
220 100+
Tnx 4 the urgent reply. yes im using MS Access.. is there anyway to update data using Connection?
Feb 2 '08 #3
lotus18
866 512MB
Tnx 4 the urgent reply. yes im using MS Access.. is there anyway to update data using Connection?
Did you try the codes on my post #2? Yes, there is an alternative option, you can open a recordset for that.

Rey Sean
Feb 2 '08 #4
werks
220 100+
wow! it works!! thanx! thanx!


Your Better Than Yesterday ^^
Feb 2 '08 #5
werks
220 100+
You save my valuable 30mins..hehehe tenk you reys!!
Feb 2 '08 #6
lotus18
866 512MB
wow! it works!! thanx! thanx!


Your Better Than Yesterday ^^
You're welcome : )
Feb 2 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Niyazi | last post by:
Hi, I have not understand the problem. Before all the coding with few application everything worked perfectly. Now I am developing Cheque Writing application and when the cheque is clear the...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
2
by: Joe Fetters via .NET 247 | last post by:
Have googled and read the VS.NET documentation can't seem to getthe answer to the following. Environment: Framework 1.1 VB.NET WinForm Access database Using all automagic tools (DataAdapter...
0
by: zhaoJian | last post by:
Here it is my code ,but it can't update the database.How to do it ? In _UpdateUnit event, I can not get the original value to @Original_UnitID,so I set a hidden column named LabelKey.But It...
1
by: rodriguez.a.christian | last post by:
I cannot make my update command work for a datagrid: Public Class subcatinsert Inherits System.Web.UI.Page Protected WithEvents SqlCon As System.Data.SqlClient.SqlConnection Protected...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.