Solved

error - The field is too small to accept the amount of data you attempted to add?

Posted on 2004-08-31
1
1,684 Views
Last Modified: 2007-12-19
this is the error i am getting, code also follows:

 The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.

Source Error:

Line 13:
Line 14:         cnn.Open()
Line 15:         cmd.ExecuteNonQuery()
Line 16:         cnn.Close()
Line 17:


Source File: C:\wwwroot\connectinglondon\test1.aspx    Line: 15



<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
      <script language="VB" runat="server">
            
       Sub Submit_Click(Sender as Object, e as EventArgs)
               Dim cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("cl.mdb"))
        Dim cmd As New OleDb.OleDbCommand
        cmd.CommandText = "INSERT INTO members (title, first_name, last_name) VALUES (' & title.Value  & ', ' & first_name.Value  & ', ' & last_name.Value & ')"
        cmd.Connection = cnn

        cnn.Open()
        cmd.ExecuteNonQuery()
        cnn.Close()

        cmd.Dispose()
        cnn.Dispose()
     
     end sub
      
      </script>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>

 <form runat="server">
 
 <input type="text" id="title" value="Title" runat="server"><br>
 <input type="text" id="first_name" value="First Name" runat="server"><br>
 <input type="text" id="last_name" value="Last Name" runat="server"><br>
 <input type="text" id="company_name" value="Company Name" runat="server"><br>
 <input type="text" id="number" value="House Number" runat="server"><br>
 <input type="text" id="street" value="Street" runat="server"><br>
 <input type="text" id="town" value="Town" runat="server"><br>
 <input type="text" id="postcode" value="Postcode" runat="server"><br>
 <input type="text" id="telephone" value="Telephone" runat="server"><br>
 <input type="text" id="fax" value="Fax" runat="server"><br>
 <input type="text" id="email" value="Email" runat="server"><br>
 <input type="text" id="password" value="Password" runat="server"><br>
 <input type="text" id="web_address" value="Web Address" runat="server"><br>

 <input type="submit" OnServerClick="Submit_Click" value="Submit" runat="server"><br>
 
 </form>



</body>
</html>
0
Comment
Question by:pigmentarts
1 Comment
 
LVL 17

Accepted Solution

by:
AerosSaga earned 500 total points
ID: 11942697
That means that in your Access Database you have defined the text field too small to hold all the text you are trying to insert.  
1) Open the Access DB
2) Open the table in design view
3) select the fields that are in doubt and increase the max size, or set them to be a memo type which is for long text.
4) problem solved
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now