HELP! The field is too small to accept the amount of data you attempted to add. Try inserting or pas

  • Thread starter Thread starter astroboy
  • Start date Start date
A

astroboy

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)

SQL:

INSERT INTO
Items([Type_ID],[taxcode_id],[account_id],[category_id],[superceeded_item_id
],[part_sort_no],[class_code],[description],[on_hand_qty],[on_hold_qty],[on_
order_qty],[bin],[suggest_sell_qty],[pack_qty],[unit_cost],[average_cost],[c
ost],
  • ,[wholesale],[trade],[price1],[price2],[price3],[price4],[price5]
    ,[is_delete_expired_pn],[is_taxable],[is_active],[is_update],[is_discountabl
    e],[part_discount_code],[max_discount],[stock_code],[movement_code],[return_
    code],[uom],[month_no_sale],[sales_since_ordered],[rop],[bsl],[minimum_qty],
    [maximum_qty],[reorder_method],[reorder_value],[counted],[last_counted_date]
    ,[last_counted_qty],[last_order_date],[last_order_qty],[last_force_order_qty
    ],[last_adj_date],[last_adj_qty],[last_pb_update_date],[last_pb_effective_da
    te],[last_sell_price],[drop_status],[date_created],[date_modified],[pack_cod
    e],[family],[unit_cost_code],[maxi_code],[part_type_code],[part_age],[status
    _code]) VALUES
    (0,0,0,0,0,'aaa','aaa','desc',3,3,3,'bin1',50,3,4,4,4,4,4,4,4,4,4,4,4,True,F
    alse,False,False,True,'part dis',3,'stco code','mov cod','ret
    code','oem',3,4,4,4,0,2,'reorder',3,True,True,3,'3/3/2003',3,3,'3/3/2004',3,
    '4/4/2004','5/5/2005',3,'drop','6/6/2006','7/7/2007','pack code',3,'unit
    cost','maxi','part',3,'33')

    SQL-ERROR: Source: Microsoft JET Database Engine

    Message:The field is too small to accept the amount of data you attempted to
    add. Try inserting or pasting less data.
 
Hi,

Look at the field sizes in the database. You are probably trying to
add too many characters into one of the fields. (ie add 3 characters into a
field that holds 2)

Ken
---------------
astroboy said:
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)

SQL:

INSERT INTO
Items([Type_ID],[taxcode_id],[account_id],[category_id],[superceeded_item_id
],[part_sort_no],[class_code],[description],[on_hand_qty],[on_hold_qty],[o
n_order_qty],[bin],[suggest_sell_qty],[pack_qty],[unit_cost],[average_cost],[cost],
  • ,[wholesale],[trade],[price1],[price2],[price3],[price4],[price5],[is_delete_expired_pn],[is_taxable],[is_active],[is_update],[is_discountable],[part_discount_code],[max_discount],[stock_code],[movement_code],[return_code],[uom],[month_no_sale],[sales_since_ordered],[rop],[bsl],[minimum_qty],[maximum_qty],[reorder_method],[reorder_value],[counted],[last_counted_date],[last_counted_qty],[last_order_date],[last_order_qty],[last_force_order_qty
    ],[last_adj_date],[last_adj_qty],[last_pb_update_date],[last_pb_effective_
    date],[last_sell_price],[drop_status],[date_created],[date_modified],[pack_code],[family],[unit_cost_code],[maxi_code],[part_type_code],[part_age],[status
    _code]) VALUES
    (0,0,0,0,0,'aaa','aaa','desc',3,3,3,'bin1',50,3,4,4,4,4,4,4,4,4,4,4,4,True,F
    alse,False,False,True,'part dis',3,'stco code','mov cod','ret
    code','oem',3,4,4,4,0,2,'reorder',3,True,True,3,'3/3/2003',3,3,'3/3/2004',3,
    '4/4/2004','5/5/2005',3,'drop','6/6/2006','7/7/2007','pack code',3,'unit
    cost','maxi','part',3,'33')

    SQL-ERROR: Source: Microsoft JET Database Engine

    Message:The field is too small to accept the amount of data you attempted to
    add. Try inserting or pasting less data.
 
I run that exact query in Ms Access and it's working though. Shouldn't be
because of size.

Ken Tucker said:
Hi,

Look at the field sizes in the database. You are probably trying to
add too many characters into one of the fields. (ie add 3 characters into a
field that holds 2)

Ken
---------------
astroboy said:
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)

SQL:

INSERT INTO
Items([Type_ID],[taxcode_id],[account_id],[category_id],[superceeded_item_id
],[part_sort_no],[class_code],[description],[on_hand_qty],[on_hold_qty],[o
n_
order_qty],[bin],[suggest_sell_qty],[pack_qty],[unit_cost],[average_cost],[cost],
  • ,[wholesale],[trade],[price1],[price2],[price3],[price4],[price5],[is_delete_expired_pn],[is_taxable],[is_active],[is_update],[is_discountable],[part_discount_code],[max_discount],[stock_code],[movement_code],[return_code],[uom],[month_no_sale],[sales_since_ordered],[rop],[bsl],[minimum_qty],[maximum_qty],[reorder_method],[reorder_value],[counted],[last_counted_date],[last_counted_qty],[last_order_date],[last_order_qty],[last_force_order_qty
    ],[last_adj_date],[last_adj_qty],[last_pb_update_date],[last_pb_effective_
    da
    te],[last_sell_price],[drop_status],[date_created],[date_modified],[pack_code],[family],[unit_cost_code],[maxi_code],[part_type_code],[part_age],[status
    _code]) VALUES
    (0,0,0,0,0,'aaa','aaa','desc',3,3,3,'bin1',50,3,4,4,4,4,4,4,4,4,4,4,4,True,F
    alse,False,False,True,'part dis',3,'stco code','mov cod','ret
    code','oem',3,4,4,4,0,2,'reorder',3,True,True,3,'3/3/2003',3,3,'3/3/2004',3,
    '4/4/2004','5/5/2005',3,'drop','6/6/2006','7/7/2007','pack code',3,'unit
    cost','maxi','part',3,'33')

    SQL-ERROR: Source: Microsoft JET Database Engine

    Message:The field is too small to accept the amount of data you
    attempted
    to
    add. Try inserting or pasting less data.
 
Back
Top