Sql Issue - Posted (924 Views)
Advanced Member
Carefree
Posts: 4224
4224
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. <
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
The date value is wrong. For Access, it should be #2008-06-16#, if the field is of the date type.<
Posted
Advanced Member
Carefree
Posts: 4224
4224
I'll try setting it that way, but why would that result in a "field size too small" message?<
Posted
Advanced Member
Carefree
Posts: 4224
4224
Duhhhhhhhhhhhhhhhhhhhhhhh

I feel like the world's biggest dunce. The silly thing is DIVIDING the date.....<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Posted
Average Member
Andy Humm
Posts: 908
908
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?<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
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.<
 
You Must enter a message