|
-
Jan 31st, 2008, 06:35 AM
#1
Thread Starter
Addicted Member
[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
-
Jan 31st, 2008, 06:45 AM
#2
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)
-
Jan 31st, 2008, 07:14 AM
#3
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|