Forum Moderators: open

Message Too Old, No Replies

ASP Update Problems

         

timhisu

10:57 pm on Nov 3, 2004 (gmt 0)

10+ Year Member



I'm trying to update a record in an Access Database, and I'm getting the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

Here is a Response.Write of my SQL string:

UPDATE events SET title = 'Pumpkin Carving Contest', date = #11/3/2004#, all_day = false, start_time = #4:00:00 PM#, end_time = #7:00:00 PM#, location = ' Edwards Dining Center', cost = 0, desc = 'Halloween is just around the corner! Celebrate the spooky spirit with a pumpkin carving contest. Sign up at Edwards Dining Center. The contest will take place during dinner on Oct 28. Students will judge the pumpkins that night. First, second, and third place winners will be awarded giant size Halloween treats.' WHERE id = 3

Anyone got an idea? I've really looked everywhere on the net for a clue to what I'm doing wrong. I'm sure it something small and silly.

Thanks in advance.

txbakers

12:23 am on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried to run this query directly in Access without ASP?

I think your time syntax is wrong.

wackal

5:20 am on Nov 4, 2004 (gmt 0)

10+ Year Member



one of your fields is named date, which is an Access keyword. try surrounding the date field with brackets like this, [date]

that should solve your problem

timhisu

3:05 pm on Nov 4, 2004 (gmt 0)

10+ Year Member



I tried putting the date in [ ]. Here is what I got:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

And here is the new SQL:

UPDATE events SET title = 'Pumpkin Carving Contests', [date] = #11/3/2004#, all_day = false, start_time = #4:00:00 PM#, end_time = #7:00:00 PM#, location = ' Edwards Dining Center', cost = 0, desc = 'Halloween is just around the corner! Celebrate the spooky spirit with a pumpkin carving contest. Sign up at Edwards Dining Center. The contest will take place during dinner on Oct 28. Students will judge the pumpkins that night. First, second, and third place winners will be awarded giant size Halloween treats.' WHERE id = 3

timhisu

3:27 pm on Nov 4, 2004 (gmt 0)

10+ Year Member



How do I run the query directly in Access? I cant find an option for that.

defanjos

3:38 pm on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cost = 0

Is this correct?

shouldn't it be?
cost = '0'

timhisu

3:45 pm on Nov 4, 2004 (gmt 0)

10+ Year Member



figured it out. Apparently desc is a reserved keyword as well.

thanks anyway!

(i figured out the sql thing in access as well)