Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2007
    Location
    Chennai, Tamil Nadu, India
    Posts
    71
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Access no error if string length > 255

    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
    cons.Execute(str)

    if err.Number<>0 then
    response.write err.description
    response.end
    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...

    ----
    Last edited by jayapalchandran; 01-14-2007 at 11:49 AM. Reason: an error
    http://vikku.info/
    - யானைக்கும் அடிசறுக்கும்

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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

    Code:
    If Len(somevariable) > 255 Then 
         'Handle before an error ocurs
    Else
         '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
    Last edited by miranda; 01-14-2007 at 08:09 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •