Sql Issue

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/67277?pagenum=1
05 November 2025, 06:52

Topic


Carefree
Sql Issue
16 June 2008, 14:25


Anybody want to take a stab at this one? Here's the error message.
Code:

Microsoft JET Database Engine error '80040e57' 

The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.

/itw/admin_post_limits.asp, line 96

Here are the lines involved:
Code:

	 if Request.Form("Method_Type") = "Limit" and _
Request.Form("MEMBER_ID") <> "" and IsNumeric(Request.Form("MEMBER_ID")) = true and _
Request.Form("POST_LIMIT") <> "" AND IsNumeric(Request.Form("POST_LIMIT")) = true then
if mid(NOW,10,1) < "9" then
strPDT = left(NOW,9)
else
strPDT = left(NOW,10)
end if
strSql = "INSERT INTO " & strTablePrefix & "POST_LIMITS (MEMBER_ID, POST_LIMIT, POST_DATE, POSTS_TODAY) VALUES (" & FMID & ", " & FMPL & ", " & strPDT & ", 0);"
set rsPLimits=my_Conn.execute(strSql)
if not rsPLimits.EOF or not rsPLimits.BOF then 'Member already on limit list

And here's the output of the sql:

Code:
INSERT INTO FORUM_POST_LIMITS (MEMBER_ID, POST_LIMIT, POST_DATE, POSTS_TODAY) VALUES (2, 1, 6/16/2008, 0);
Length of 'Member_ID'=1
Length of 'Post_Limit'=1
Length of 'Post_Date'=9

The fields are set as long integer for all but the date, it's set to 15 characters but will never exceed 11. <

 

Replies ...


ruirib
16 June 2008, 14:28


The date value is wrong. For Access, it should be #2008-06-16#, if the field is of the date type.<
Carefree
16 June 2008, 14:32


I'll try setting it that way, but why would that result in a "field size too small" message?<
Carefree
16 June 2008, 14:34


Duhhhhhhhhhhhhhhhhhhhhhhh

I feel like the world's biggest dunce. The silly thing is DIVIDING the date.....<
ruirib
16 June 2008, 14:38


smile<
Andy Humm
16 June 2008, 17:14


Carefree, come on, get in the corner and put that hat on... No seriously, we all have our forgetful moments and mine is right now! How do you get to show the output of the sql?<
ruirib
16 June 2008, 17:41


Originally posted by Andy Humm
Carefree, come on, get in the corner and put that hat on... No seriously, we all have our forgetful moments and mine is right now! How do you get to show the output of the sql?
A Response.Write followed by a Response.End wink.<
© 2000-2021 Snitz™ Communications