Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error updating DB with checkboxes

Status
Not open for further replies.

DanT07

Programmer
May 11, 2005
38
0
0
GB
Hello all.

I have a page which lists several records from an sql server database. Each row has 4 checkboxes each which can be ticked or unticked and then updated to the database. However sometimes there might be 10 rows on page which means 40 checkboxes. On my machine the page works fine all the time, i have no errors ever. But on another machine in the building i get a 'Page Can Not Be Displayed' error along with 'Cannot find server or DNS Error'. This is fairly random but usually only happens when over 25 (approximate guess) checkboxes are checked.

Does anyone have any idea what might be causing such an error?
 
Try using Response.Write to output the SQL string. It might be getting quite long.
 
Well the sql strings are individual updates for each checkbox in a loop, ie. along these lines:

<% do while not rs.eof %>
<% if packagingvalue = "on" then
sql = "UPDATE [Stock IN] SET P = 1 WHERE AutoRef = '"&AutoRef&"'"
conn.execute(sql)
else
sql = "UPDATE [Stock IN] SET P = 0 WHERE AutoRef = '"&AutoRef&"'"
conn.execute(sql)
end if %>
<% end if %>
<% rs.movenext %>
<% loop %>

So can it get too long like that?
 
No, I was under the mistaken assumption that you were creating one SQL statement to update 40 fields.

The length shouldnt be the problem since you are running up to 40 separate short SQL statements.
 
Does it always happen when the remote client has all 40 of the boxes checked or only randomly?
 
It does only happen when there are about 25/30 boxes checked. However it will work ok occasionally even on those machines. 9 times out of 10 it comes up with the error though.

One difference i can see between my machine and theirs is they run their internet through a proxy. Would that affect it?
 
The fact that it works occasionally even on those machines where it fails 90% of the time is quite puzzling.

The machines may be going through a proxy, but the database interaction is going only from your web server to the database.

As long as the web server is getting a proper Request from the proxied machines everything else should be the same once you get the request.

Is it possible that you have a malformed request? Or that something is timing out?
 
Well I have tested it a bit with and without the proxy and it does seem to be the problem. Why? I dont know but when i disable it the error goes away.

P.S. How long do members stay 'New' here?
 
If you mean the yellow "new" next to the member's handle, that means the post is new, not the member.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top