473,569 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The field is [NOT] too small to accept the amount of data you...

geolemon
39 New Member
I'm getting an error, I'm not seeing the cause:

"Run time error '-2147217833(8004 0e57)':
The field is too small to accept the amount of data you attempted to
add. Try inserting or pasting less data.

[end] [debug] [help]
Debug highlights this segment of code (I just snipped a portion here):
Expand|Select|Wrap|Line Numbers
  1.  strProc = "Insert into Parts (MfgPN, Manufacturer, Description)" & _
  2.                "select distinct PurchasedPN, Manufacturer, Description " & _
  3.                "from DBimport where PurchasedPN is not null " & _
  4.                "and PurchasedPN not in (select MfgPN from Parts) " & _
  5.                "group by PurchasedPN, Manufacturer, Description"
  6.  
  7.      'insert into Parts:
  8.      conTAGdb.Execute strProc
The "Execute" line is highlighted as the current step.

I have two VBA scripts that make up this user-operated process:
The first script: User is prompted to naviagate to a specially formatted file that he has prepared for import, and imports it into a DBimport temporary table.
The second script: User is prompted to assign a job number, and the script processes the DBimport table into the tables in the database.

This error is occurring in the second script, which is particularly baffling to me since my DBimport table shares the same column definitions as the columns in the target tables.

It doesn't specifically implicate one particular column here, but there are only three in this operation:
MfgPN - "text" in DBimport, "text" in Parts
Manufacturer - "text" in DBimport, "text" in Parts
Description - "text" in DBimport, "text" in Parts

How, if the data is resident in DBimport, could I throw this error doing an insert of this data into Parts?


Any help is greatly appreciated!!
Nov 28 '08 #1
7 6700
ADezii
8,834 Recognized Expert Expert
Could it be possible that you have a size limitation on the Append Table that is less than the Manufacturing Table, namely:
Expand|Select|Wrap|Line Numbers
  1. [Manufacturer] in DBImport [TEXT 50]
  2. [Manufacturer] in Parts [TEXT 25]
Nov 28 '08 #2
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Either of the Fields : MfgPN, Manufacturer, Description..
TextLength Of Destination is smaller than the TextLength/Size of the Source..

REgards
Veena
Nov 29 '08 #3
ADezii
8,834 Recognized Expert Expert
Hello geolemon! I've reproduced your problem to the extent that I could, and had no problem with the Append Operation whatsoever, the SQL is sound. I've provided the same functionality, but only DAO code based. Kindly Copy and Paste this code and see if it is functional within your context, then we will proceed from there. Good Luck!
Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2. Dim MyDB As DAO.Database
  3. Dim rstFrom As DAO.Recordset
  4. Dim rstTo As DAO.Recordset
  5.  
  6. Set MyDB = CurrentDb
  7.  
  8. strSQL = "SELECT DISTINCT PurchasedPN, Manufacturer, Description " & _
  9.          "FROM DBImport " & _
  10.          "WHERE DBImport.PurchasedPN Is Not Null And DBImport.PurchasedPN Not In (Select MfgPN From Parts) " & _
  11.          "GROUP BY PurchasedPN, Manufacturer, Description;"
  12.  
  13. Set rstFrom = MyDB.OpenRecordset(strSQL, dbOpenForwardOnly)
  14. Set rstTo = MyDB.OpenRecordset("Parts", dbOpenDynaset)
  15.  
  16. With rstFrom
  17.   Do While Not .EOF
  18.     rstTo.AddNew
  19.       rstTo![MfgPN] = ![PurchasedPN]
  20.       rstTo![Manufacturer] = ![Manufacturer]
  21.       rstTo![Description] = ![Description]
  22.     rstTo.Update
  23.     .MoveNext
  24.   Loop
  25. End With
  26.  
  27. rstFrom.Close
  28. rstTo.Close
  29. Set rstFrom = Nothing
  30. Set rstTo = Nothing
P.S. - The code has been thoroughly tested and is fully operational. SQL is not my strong point, so I'll call in some of the 'real' Experts/Moderators.
Nov 29 '08 #4
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hi Geolemon. Like ADezii's original reply and QVeen's I'd look at the field sizes. Your SQL works perfectly for me too using basic test data in two tables set up as yours are. The only explanation I can come up with for the 'too big' error message is what ADezii and QVeen have already suggested. It certainly appears that one or more of the three fields in one of the rows of DBImport contains data that is longer in size than the corresponding field in Parts can contain.

-Stewart
Nov 29 '08 #5
ADezii
8,834 Recognized Expert Expert
  1. Try setting the Text Size of the Fields in the Parts Table to {TEXT 255} then do the Append Operation. Let us know what happened.
  2. Could it be possible that Unicode Compression is turned ON in one or more Fields in the FROM Table and OFF in the Append Table?
    The first script: User is prompted to naviagate to a specially formatted file that he has prepared for import, and imports it into a DBimport temporary table.
  3. Is this 'specially formatted file' Fixed Width ASCII, and are these Fields padded?
Nov 29 '08 #6
NeoPa
32,564 Recognized Expert Moderator MVP
Until the OP returns with a response I will assume this is fully answered.

One point I would make though, is that there hardly seems the need for the GROUP BY clause if the SELECT clause already includes the DISTINCT predicate.
Nov 30 '08 #7
ADezii
8,834 Recognized Expert Expert
@NeoPa
Thanks NeoPa, that was going to be another question! (LOL).
Nov 30 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
10191
by: F. Barth | last post by:
Hello, I've posted this problem to one other newsgroups, and gotten some diagnostic help, but I still need a solution. The full text of the message box is: "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data". This displays without a run-time error number. This error comes about...
1
2257
by: RWC | last post by:
Hello, I'm getting the error "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data" when I run a report. I'm simply trying to apply the following criteria/filter to this report "kEmployee in(select kEmployee from proCriteria;)" I'm not really trying to insert any data. This same...
4
5397
by: Mal | last post by:
I have an ACC 2000 database that has a strange behaviour I have a small table, with just a few fields... My report has very simple grouping and sorting, no code bar a NODATA event. I have a memo field When CAN GROW is set to NO everything works just fine. When CAN GROW is set to YES - watch out.... One record causes BIG
8
1554
by: Tony Williams | last post by:
I have a form where the user inputs a series of figures into a number of controls. After they've input the total (they don't want the program to create the total) there is a check to make sure the total of the controls equals the totals they've input. Here is the code in the Before Update property: Private Sub txtAdvTot_BeforeUpdate(Cancel...
4
3099
by: bill.brennum | last post by:
Hi, This is probably a question with a simple answer, but here goes. I have a form linked to a table. There is a field on that table that while not showing on the form, I would like to populate via a lookup using either a popup or subform. This is an employee name match application that will allow a user to lookup a corporate employee...
4
17956
by: astroboy | last post by:
Help! I run into error when my query is too long, anyway to solve this?? Dim objCommand As New OleDb.OleDbCommand(sql, objConn) Dim objDataAdapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(objCommand) intNumOfRec = objDataAdapter.Fill(objData)
4
2112
by: nepifanio | last post by:
Hi Guys, I'm trying to import data out of MySQL db to MS Access 2003 using ImportXML. I don't have any problems doing the import, except for one table with a "text" field defined. I'm getting an error message saying "The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.". Thanks,
16
4863
by: Mark | last post by:
Hello. I am attempting to use AppendChunk() to write binary data to a memo field in Access 2000. My initial call to AppendChunk() results in a data type conversion error. Any suggestions? Here is a VBA function which demonstrates the problem. Thanks -Mark
5
7866
by: betaphase | last post by:
I am new to Access and I'm having trouble with a database someone else created. I am wondring why I am not being able to insert more than 255 characters to a memo field in Access 2003. We need a field in our database to allow us to enter a short summary of the job we are referencing. I can format the "data type" of the entry to be a "memo"...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.