Solved

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

Posted on 2004-08-31
1
1,742 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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