Forum Moderators: coopster & phranque

Message Too Old, No Replies

Update Stmt takes three tries (sometimes)

Why does it not work sometimes......

         

txbakers

6:14 am on Mar 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm baffled. I have a form that updates just fine, most of the time. Sometimes it takes two or three tries to update the table. The fields are random. I tried clicking away after changing a box, tabbing away, and I can't find the culprit.

I've examined the SQL and it looks good, and it does work 95% of the time.

Why should it not update the page some of the time? If I chnge two boxes, one will change.

Using ASP with Access.

I can post the SQL/ASP if that will help.

Thanks.

sugarkane

2:21 pm on Mar 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I can post the SQL/ASP

Yup, if you could post a few lines it might be of help. Do you get any errors when the update fails? Could it be that the query just isn't matching any records for whatever reason?

bmcgee

2:21 pm on Mar 22, 2002 (gmt 0)

10+ Year Member



Is it possible that the event is not firing that calls the update?

In other words, is the query truly executing every time you think it should be and just failing...or is it not executing the code at all?

txbakers

2:27 pm on Mar 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. The query is not failing, no error messages. If I change two fields to update they both will, or one won't. It also doesn't matter which type of input - select or text boxes.

I suspect it has to do with the onClick handling of the button I'm using. Netscape requires the onClick to be part of the <a href> tag, which means you have to indicate an href. usually I use # in this situation.

I wonder if sometimes the browser just refreshes before firing the onClick.

I wrote some code to check the browser and if IE just put the onClick in the <img> tag, and if Netscape just show the plain jane submit button. (I know it's not entirely reliable to sniff browsers, but it's a start)

How should I post the code? Just plop it here?

william_dw

2:50 am on Mar 30, 2002 (gmt 0)

10+ Year Member



I've got a few thoughts,
although I could be late, but if nothing else it might help someone searching sometime in the future.

Using ASP & SQL I tend to find that most errors where unexpected behaviour occours are due to either
a) Special characters (such as ') interfering with your statments
b) Switching on error handling and forgetting it's hiding & logging errors instead of displaying them
-or-
c) Something on the client side has gone wrong.

Judging from what you said

If I change two fields to update they both will, or one won't. It also doesn't matter which type of input - select or text boxes.
it could be a problem with the ASP coding you are using, although without seeing the code it's tricky to tell.

Feel free to post it here (as long as it's not pages long) and I'll have a look if you still need help

Dw