View Full Version : Access no error if string length > 255

01-14-2007, 12:48 PM
i have a database and in that a field name desc for storing lengthy text...
actually the text length in access is 255 but i tried to store more that 255
i didnt get any error at the same time the data didnt get stored...

str="insert into table1 values('sa',' text more that 255 letterx')
on error resume next

if err.Number<>0 then
response.write err.description
end if

the above code didnt show any error and it didnt get saved...

how to know whether an operation is successful in access or asp...


01-14-2007, 09:06 PM
Why would you wait to see if you get an error? Why not validate before you try to do the insert? Then there is no error

If Len(somevariable) > 255 Then
'Handle before an error ocurs
'Do your insert
End IF

Also if you know that there will be a lot of times where the value can be more than 255 characters, limit the input on the client side to 255 characters or change the data type to memo which allows for more than 255 characters