Results 1 to 3 of 3

Thread: [RESOLVED] Update command not working

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    255

    Resolved [RESOLVED] Update command not working

    hello,
    I am now trying to allow users to change their passwords
    so i used the following update command....

    Update SysUser
    Set Password = '" & m_NewPwd & "'
    Where UserNo = " & m_TheUser & "

    when i run it i get a syntax error

    what is confusing me is that in another part of my program i am using an update command and it is written exactly the same,,

    Update Complaint
    Set Complaint = '" & m_TheComplaint & "'
    Where ComplaintNo = " & m_CNo & "

    I have no idea why one command will work fine but the other does not???

    Anyone have any ideas?

    Thanks,

    Iain

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Update command not working

    As this is purely related to SQL (and so databases), it belongs in the Database Development forum - thread moved.

    The problem is that at least one of your field/table names is a Reserved Word (password, and depending on the database system, possibly SysUser too), and therefore wont work in SQL statements. The best thing to do is change the names of those items, as you will repeatedly get this kind of problem otherwise.

    For more information (including lists of Reserved Words), see the article What names should I NOT use for tables/fields/views/stored procedures/...? from our Database Development FAQs/Tutorials (at the top of this forum)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    255

    Re: Update command not working

    ok i'll ppost there in future for database stuff!
    didnt realise that password was a reserved word that must be it!
    thanks for your help!!

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