如何解决“ INSERT INTO语句中的语法错误”-Access数据库
有人可以看看吗,如果您发现此INSERT语句有任何问题,请告诉我? 我正在尝试使用excel VBA插入具有124列的Access数据库的记录,由于某种原因,它给我一个错误“ INSERT INTO语句中的语法错误”。我个人认为此语句没有任何问题,但是我不确定insert语句对于访问数据库是否会那么长?我没主意了,最近两天我一直在努力解决这个问题...
任何帮助将不胜感激!非常感谢
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','NA','A','BI','1','90','Y','NAP','O','KANSASCITY','MO','US','D','1000102733','2530002703878','EA','3736','0','DD','01358600A0','7','U',''
)
解决方法
您将所有内容作为文本插入,这不太可能。
仔细检查每个字段的数据类型并进行调整,例如,调整 numeric 字段, Null 值和 date :
static Regex PinRegex = new Regex(@"\d{4}");
static bool isPin(string s) => PinRegex.IsMatch(s);
static bool isExit(string s) => s == "q";
static void PopulateArray(string[] theArray)
{
for (int i = 0; i < theArray.Length; i++)
{
Console.Write($"Please enter 4-Digit PIN or q to exit #{i + 1}: ");
string userAnswer = Console.ReadLine();
if (isExit(userAnswer))
exit(); // To be implemented
else if (isPin(userAnswer))
theArray[i] = userAnswer;
else
unrecognizedAnswer(); // To be implemented
}
}
,
我认为您需要删除以下字段名称中的空格
BOA_FSS_BPA _Contract_Number
FOB _City
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。