Michal
Michal

Reputation: 81

“Syntax error in INSERT INTO statement” - Access Database

Can someone please have a look and let me know if you can see any problems with this INSERT statement? I am trying to insert the records using excel VBA to Access Database that has 124 columns and for some reason it is giving me an error “Syntax error in INSERT INTO statement”. Personally I do not see any issues with this statement however I am not sure if the insert statement can be that long for access database? I am out of ideas and I have been trying to figure this out for last 2 days...

Any help would be greatly appreciated! Many thanks

INSERT INTO DIBBS_Table (
    Email_ID
    ,Match_ID
    ,Cage
    ,Solicitation
    ,Solicitation_Type_Indicator
    ,Small_Business_Set_Aside_Indicator
    ,Additional_Clause_Indicator
    ,Return_By_Date
    ,Quoter_Cage_Code
    ,Quote_For_Cage_Code
    ,Reserved
    ,Reserved1
    ,Reserved2
    ,Reserved3
    ,Reserved4
    ,Small_Business_And_Other
    ,Small_Disadvantage
    ,Business_Ethinc
    ,Woman_Owned
    ,Veteran_Owned
    ,HUBZone
    ,HUBZone_Joint
    ,Participating_HUBZone
    ,Reserved5
    ,Compliance_Code
    ,Compliance_Reports_Code
    ,Alternate_Disputes_Resolution
    ,Bid_Type_Code
    ,Payment_Discount_Terms_Code
    ,Vendor_Quote_Number
    ,Days_Quote_Valid
    ,Packaging_Requirement
    ,Ordering_Agreement
    ,BOA_FSS_BPA _Contract_Number
    ,BOA_FSS_BPA_Contract_Expiration_Date
    ,FOB_Point
    ,FOB _City
    ,FOB_State
    ,FOB_Country
    ,Inspection_Point_Code
    ,Place_of_Government_Inspection_Packaging_CAGE_code
    ,Supplies_CAGE_code
    ,SPI_Process_Proposed
    ,SPI_Process
    ,SPI_Facility
    ,SPI_Military_Federal
    ,SPI_Affected_Contract_Line
    ,Solicitation_Line_Number
    ,Reserved6
    ,Purchase_Request_Number
    ,NSN
    ,Unit_of_Issue
    ,Quantity
    ,Unit_Price
    ,Delivery_Days
    ,Guaranteed_Minimum
    ,O_Min
    ,Contract_Max
    ,AFB
    ,O_DO_Min_Quantity
    ,Reserved7
    ,Reserved8
    ,Immediate_Shipment_Price
    ,Immediate_Shipment_Deliver_Days
    ,Reserved9
    ,Trade_Agreements_Indicator
    ,Source_Of_Supply_Cage_Code
    ,First_Article_Waiver_Code
    ,Hazardous_Material
    ,Hazardous_Warning_labels
    ,Material_Requirements
    ,Buy_American_Indicator
    ,Free_Trade_Agreements_Indicator
    ,BA_FT_TA_End_Product
    ,BA_FT_T_Country_Of_Origin
    ,BA_FT_T_Country_Code
    ,Duty_Free_Entry_Requested
    ,Duty_Paid_Code
    ,Duty_Paid_Amount
    ,Price_Breaks_Solicited_Indicator
    ,Range_Lower
    ,Range_Upper
    ,Range_Unit_Price
    ,Range_2_Lower
    ,Range_2_Upper
    ,Range_2_Unit_Price
    ,Range_3_Lower
    ,Range_3_Upper
    ,Range_3_Unit_Price
    ,Range_4_Lower
    ,Range_4_Upper
    ,Range_4_Unit_Price
    ,Range_5_Lower
    ,Range_5_Upper
    ,Range_5_Unit_Price
    ,Rage_6_Lower
    ,Range_6_Upper
    ,Range_6_Unit_Price
    ,Quantity_Variance_Plus
    ,Quantity_Variance_Minus
    ,Minimum_Order_Quantity_Code
    ,Max_Quantity
    ,Immediate_Shipment_Available
    ,Immediate_Shipment_Quantity
    ,Manufacturer_Dealer
    ,Production_Source_CAGE_code
    ,Production_Source_Name_and_Address
    ,Item_Description_Indicator
    ,Part_Number_Offered_Code
    ,Part_Number_Offered_CAGE_code
    ,Part_Number
    ,Offered_Remarks
    ,Supplies_Offered
    ,Supplies_Offered_Remarks
    ,MFG_Cage
    ,Requirements_Source_CAGE
    ,Requirements_Item_Name
    ,Requirements_Service_Identification
    ,Requirements_Test_Number
    ,Higher_Level_Quality_Indicator
    ,Higher_Level_Quality_Code
    ,Higher_Level_Quality_Remarks
    ,Child_Labor_Certification_Code
    ,Quote_Remarks
    )
VALUES (
    '2530002703878SPE7M320U1910100010273306721'
    ,'2530002703878SPE7M320U19101000102733'
    ,'6721'
    ,'SPE7M320U1910'
    ,''
    ,'R'
    ,'N'
    ,'27/08/2020'
    ,'7QEZ4'
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,'R'
    ,'N'
    ,''
    ,''
    ,''
    ,'NA'
    ,'NA'
    ,'A'
    ,'BI'
    ,'1'
    ,''
    ,'90'
    ,'Y'
    ,'NAP'
    ,''
    ,''
    ,'O'
    ,'KANSASCITY'
    ,'MO'
    ,'US'
    ,'D'
    ,'6721'
    ,'6721'
    ,''
    ,''
    ,''
    ,''
    ,''
    ,'1'
    ,''
    ,'1000102733'
    ,'2530002703878'
    ,'EA'
    ,'3736'
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,'N'
    ,'6721'
    ,''
    ,''
    ,''
    ,'0'
    ,''
    ,''
    ,''
    ,''
    ,''
    ,'N'
    ,''
    ,''
    ,''
    ,'N'
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,'0'
    ,'0'
    ,'N'
    ,''
    ,''
    ,''
    ,'DD'
    ,'6721'
    ,''
    ,'D'
    ,'1'
    ,'6721'
    ,'01358600A0'
    ,''
    ,'1'
    ,''
    ,''
    ,''
    ,''
    ,''
    ,''
    ,'7'
    ,'7'
    ,''
    ,'U'
    ,''
    )

Upvotes: 0

Views: 421

Answers (2)

Sam
Sam

Reputation: 381

I think you need to remove the space in the following field names

BOA_FSS_BPA _Contract_Number
FOB _City

Upvotes: 3

Gustav
Gustav

Reputation: 55831

You are inserting everything as text which is very unlikely how it should be.

Double-check the data type of every field and adjust, for example for a numeric field, a Null value, and a date:

,6721
,'SPE7M320U1910'
,Null
,'R'
,'N'
,#2020/08/27#

Upvotes: 3

Related Questions