Print Page | Close Window

Error when Text Box Max Length to big

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=7726
Printed Date: 01 April 2026 at 1:00am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Error when Text Box Max Length to big
Posted By: WookMaster
Subject: Error when Text Box Max Length to big
Date Posted: 29 November 2003 at 9:12pm
I am writing a database where you enter data through text boxes then add them with a submit button.  When the max length is 35,  it works great but if I increase it to lets say 100 for a detailes message It will not work,  anyone know anything about this?  thanks



Replies:
Posted By: michael
Date Posted: 29 November 2003 at 10:41pm
the filed length in the database needs to be able to hold that amount of data.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: theSCIENTIST
Date Posted: 30 November 2003 at 6:33am

Yeah, Wook, there are two places where you can specify maxlenght, the textbox itself, in which case input will stop when it reaches the maximum lenght, it doesn't generate any errors here, and the DB fields also can have a maxlenght, this will generate errors if the inserted data is bigger than the field allowance.

If you really need to have limits like (100), you must parse user input before inserting it into the DB, here's an example:

<%
dbALLOWANCE = 100
parsedMSG = Request.Form("txtMSG")

If Len(parsedMSG) > dbALLOWANCE Then
    Response.Write "Too Big!"
End If
%>

Hope it helps.



Posted By: pmormr
Date Posted: 30 November 2003 at 9:30am
open your table in access in design view (Right click>design view) and click on the field whose max length you want to change. at the bottom of the window there will be a value in the list called "max length" change it to a bigger integer

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: pmormr
Date Posted: 30 November 2003 at 9:31am
i think that's what your problem is...

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: Semikolon
Date Posted: 30 November 2003 at 10:48am
standard length is 50 on text field in access so you have to increase that before increasing in the textbox in your form


Posted By: Mart
Date Posted: 30 November 2003 at 10:53am
The maximum length for a Textfield in access is 255 so you can't store lots of data in it. Try a Memo field.


Posted By: Semikolon
Date Posted: 30 November 2003 at 10:56am

there you can store up to 65 535 characters



Posted By: WookMaster
Date Posted: 30 November 2003 at 4:57pm
thanks for the help guys,  I changed it from text to memo I saw it somewhere online and it worked.  sorry for delayed response



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net