Results 1 to 7 of 7

Thread: Need Help How To Update Db

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    27

    Exclamation

    I have a prob in updateing my db
    I tried :

    DbCon.Execute " update tbl1 set (fname = '" & FnameTxt & "' , lname = '" & LnameTxt & "' , dateofbirth = '" & DateofbirthTxt & "' , where id = '" & IdTxt & "')"

    but it dosent work for a reason

    Thnks in advance 4 your help ...

    J5


  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb Missing semicolon ;

    Missing semocolon at the end of the statement
    Code:
    DbCon.Execute "update tbl1 set fname = '" & FnameTxt & "', lname = '" & LnameTxt & "', dateofbirth = '" & DateofbirthTxt & "', where id = '" & IdTxt & "'"
    should be like this...
    Code:
    DbCon.Execute "update tbl1 set fname = '" & FnameTxt & "', lname = '" & LnameTxt & "', dateofbirth = '" & DateofbirthTxt & "', where id = '" & IdTxt & "';"


    [Edited by Chris on 06-11-2000 at 02:50 PM]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    27

    10x

    Well Chris 10x 4 your help
    But it dosent work i dont know
    why ...

    But again 10x


  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Standard SQL (you can include theJet Update statement, too) doesn't use paren's after the set command. Have you tried:

    DbCon.Execute "update tbl1 set fname = '" & FnameTxt & "', lname = '" & LnameTxt & "', dateofbirth = '" & DateofbirthTxt & "', where id = '" & IdTxt & "'"



  5. #5
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Re: 10x

    Originally posted by Jony5
    Well Chris 10x 4 your help
    But it dosent work i dont know
    why ...
    BTW, may i know the datatype in each fields?

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    27

    Chris ...

    Well all the fileds is text
    expet the last one that he is a date

    but i dont care to take him as a string
    and later on i`ll fix it

  7. #7
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb Extra comma before WHERE clause

    It have extra comma before the WHERE Clause,
    Code:
    DbCon.Execute "update tbl1 set fname = '" & FnameTxt & "', lname = '" & LnameTxt & "', dateofbirth = '" & DateofbirthTxt & "', where id = '" & IdTxt & "';"
    should be like this...
    Code:
    DbCon.Execute "UPDATE tbl1 SET fname = '" & FnameTxt & "', lname = '" & LnameTxt & "', dateofbirth = '" & DateofbirthTxt & "' WHERE id = '" & IdTxt & "';"

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