PDA

View Full Version : Does anyone see a problem with this Update


isleshocky77
09-27-2002, 03:28 AM
I get this error:

Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.


on this code:

UPDATE profile SET Name='Stephen Ostrow', NickName='Ozzie', username='Isleshocky77', password='hello', Privelidge='Admin', Type='player', PhoneNumber='(516)826-3574', EmailAddress='Isleshocky77@sowebdesigns.com', MobileNumber='(516)263-3574', aim='Isleshocky77', School='Mepham', image=1, EmailAvail=1, PhoneAvail=0, MobileAvail=0, AddressAvail=0 WHERE PID=6

I can't find a problem with it.. maybe someone else can.

victoria_1018
09-27-2002, 04:08 AM
I can't really tell where is the error, I think there isn't any error with the update statement, but the problem may occur to codes related to your update statement. Do have a look on it.
vict

isleshocky77
09-27-2002, 04:24 AM
Sorry I don't get what you mean.. that is the print out of my Update statement as executed... I just found out if I delete all the fields after the username it works, leading me to believe there is an error in the password update.. but I tried removing just that one and I still got the error, plus, I can't find anything wrong with the password update. Please help. And thanx for any so far

victoria_1018
09-27-2002, 04:28 AM
Do you have a database attached to the program? Iy you do, you will have to ensure the field names use in the program is the same as those in the database. Another thing is I suspect there isn't any problem with the update statement. But the problem lies on the codes where you verify the fields before you do the update. take a look at these areas. (Also make sure do not use any reserve words in your update statement)
regards

whammy
09-27-2002, 04:29 AM
If I remember right, "password" is a reserved word in Access - perhaps that's causing the problem? I had to name my password field "pass" in order to get it to work awhile back...

If not, what is the datatype of each field?

isleshocky77
09-27-2002, 04:34 AM
Umm.. I havn't had ne problems with the password field up till now and I've used the insert to with the same setup.. but I will check, the other thing is I tried removing that one from the update and still go the same problem.

whammy
09-28-2002, 01:10 AM
Whenever you get a syntax error in a SQL statement, do this:

MYQUERY = "WHATEVER THE QUERY IS"
Response.Write(MYQUERY) : Response.End

That will output the querystring to the page, and allow you to look through it for possible problems; or better yet, you can paste that query into Query Analyzer and it should help you in debugging it.

:D

isleshocky77
09-28-2002, 05:17 AM
Posted in the first post is my outputted query, that is the first thing I did... and thats what it looks like.. What is this query analyser you speak of?

whammy
09-28-2002, 05:29 PM
Well, if "password" isn't your problem, make sure you check the datatypes of each field in your database...

Strings require '' around them whereas integers don't - are you perhaps storing the phone number as an integer? If so that will definitely throw that error since you have () in it.

isleshocky77
09-29-2002, 12:06 AM
Thanks for all the help, apparently... It was both the 'password' and 'type' fields.. but it only gives me problems with Update for somereason.. b/c the insert into and select worked fine.. but I fixed so I let it be. But thank you.