Results 1 to 5 of 5

Thread: [RESOLVED] sql update statement help

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Resolved [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.

  2. #2
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    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 ?
    thanks
    amrita

  3. #3
    Lively Member
    Join Date
    May 2008
    Location
    Manila, Philippines
    Posts
    81

    Re: sql update statement help

    yup, you should add a where condition so as to filter the records to be updated

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: sql update statement help

    Take a moment and go through our database FAQ section.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    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
  •  



Click Here to Expand Forum to Full Width