Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-31
1
Medium Priority
?
1,768 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

704 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