|
-
May 28th, 2008, 04:21 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] sql update statement help
hi,currently i want to update the sql data from the textbox amend data.
once i execute the sql query all the database will update to same value of textbox.i only want to update 1 row data from the textbox amended,not all the database field.please help.
Code:
sSQL = "Update SpcData set PartNo = '" & txtpartno.Text & "',Dimension ='" & txtdimension.Text & "',MachineNo = '" & txtmachineno.Text & "', Inspector = '" & Txtinspector.Text & "', Date ='" & txtdate.Text & "' ,Time = '" & txttime.Text & "',SampleNo ='" & txtsampleno.Text & "', Data = '" & txtdata.Text & "'"
conn.Execute sSQL
thanks.
-
May 28th, 2008, 04:45 AM
#2
Re: sql update statement help
To update one row add a where clause
Code:
Update tblName
Set Col = Value
Where Id = IdValue
Is this what you are looking for ?
-
May 28th, 2008, 06:59 AM
#3
Lively Member
Re: sql update statement help
yup, you should add a where condition so as to filter the records to be updated
-
May 28th, 2008, 10:13 AM
#4
Re: sql update statement help
Take a moment and go through our database FAQ section.
-
May 28th, 2008, 10:48 PM
#5
Thread Starter
Fanatic Member
Re: sql update statement help
hei thank guys,the problem has been solved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|