I'm trying to run the following code, but it keeps giving me a "Syntax error in INSERT INTO statement."
I found that my SQL Command string (sqlCmdPOCreate ) is not getting the whole string (cuts it off at around @ItemFPartNumbe r) I tested this in the watch window while the code was running.
How can I make this work?
Code Sample (sorry, it's huge):
I found that my SQL Command string (sqlCmdPOCreate ) is not getting the whole string (cuts it off at around @ItemFPartNumbe r) I tested this in the watch window while the code was running.
How can I make this work?
Code Sample (sorry, it's huge):
Code:
sqlCmdPOCreate = "INSERT INTO PurchaseOrder (PurchaseOrderNumber, POIssueDate, SupplierName, SupplierAddress, SupplierCity, SupplerStateOrProvince, SupplierZipOrPostalCode, SupplierCountry, SupplierPhone, SupplierFax, ShipToName, ShipToAddress, ShipToCity, ShipToStateOrProvince, ShipToZipOrPostalCode, ShipToCountry, ShipToPhone, ShipToFax, SupplierQuoteNo, Terms, OriginatedBy, RequiredDate, ShipVia, ShippingTerms, FOBPoint, PSTExemptionNumber, ReferenceNumber, ReferenceDescription, SubTotal, GST, PST, Total, SIMSDS, SIOutsourcedProduction, SIIntercompanyTransaction, SIConfirmationOnly, SIMaterialCertification, ApprovedBy, ItemDPartNumber, ItemDQuantity, ItemDDescription, ItemDUnit, ItemDUnitPrice, ItemDCurrency, ItemDExtension, ItemDGLCode, ItemBPartNumber, ItemBQuantity, ItemBDescription, ItemBUnit, ItemBUnitPrice, ItemBCurrency, ItemBExtension, ItemBGLCode, ItemCPartNumber, ItemCQuantity, ItemCDescription, ItemCUnit, ItemCUnitPrice, ItemCCurrency, ItemCExtension, ItemCGLCode, ItemDPartNumber, ItemDQuantity, ItemDDescription, ItemDUnit, ItemDUnitPrice, ItemDCurrency, ItemDExtension, ItemDGLCode, ItemEPartNumber, ItemEQuantity, ItemEDescription, ItemEUnit, ItemEUnitPrice, ItemECurrency, ItemEExtension, ItemEGLCode, , ItemFPartNumber, ItemFQuantity, ItemFDescription, ItemFUnit, ItemFUnitPrice, ItemFCurrency, ItemFExtension, ItemFGLCode, ItemGPartNumber, ItemGQuantity, ItemGDescription, ItemGUnit, ItemGUnitPrice, ItemGCurrency, ItemGExtension, ItemGGLCode, ItemHPartNumber, ItemHQuantity, ItemHDescription, ItemHUnit, ItemHUnitPrice, ItemHCurrency, ItemHExtension, ItemHGLCode, ItemIPartNumber, ItemIQuantity, ItemIDescription, ItemIUnit, ItemIUnitPrice, ItemICurrency, ItemIExtension, ItemIGLCode, , ItemJPartNumber, ItemJQuantity, ItemJDescription, ItemJUnit, ItemJUnitPrice, ItemJCurrency, ItemJExtension, ItemJGLCode, ItemKPartNumber, ItemKQuantity, ItemKDescription, ItemKUnit, ItemKUnitPrice, ItemKCurrency, ItemKExtension, ItemKGLCode, ItemLPartNumber, ItemLQuantity, ItemLDescription, ItemLUnit, ItemLUnitPrice, ItemLCurrency, ItemLExtension, ItemLGLCode, ItemMPartNumber, ItemMQuantity, ItemMDescription, ItemMUnit, ItemMUnitPrice, ItemMCurrency, ItemMExtension, ItemMGLCode, ItemNPartNumber, ItemNQuantity, ItemNDescription, ItemNUnit, ItemNUnitPrice, ItemNCurrency, ItemNExtension, ItemNGLCode, ItemOPartNumber, ItemOQuantity, ItemODescription, ItemOUnit, ItemOUnitPrice, ItemOCurrency, ItemOExtension, ItemOGLCode, ItemPPartNumber, ItemPQuantity, ItemPDescription, ItemPUnit, ItemPUnitPrice, ItemPCurrency, ItemPExtension, ItemPGLCode, ItemQPartNumber, ItemQQuantity, ItemQDescription, ItemQUnit, ItemQUnitPrice, ItemQCurrency, ItemQExtension, ItemQGLCode, ItemRPartNumber, ItemRQuantity, ItemRDescription, ItemRUnit, ItemRUnitPrice, ItemRCurrency, ItemRExtension, ItemRGLCode) VALUES (@PurchaseOrderNumber, @POIssueDate, @SupplierName, @SupplierAddress, @SupplierCity, @SupplerStateOrProvince, @SupplierZipOrPostalCode, @SupplierCountry, @SupplierPhone, @SupplierFax, @ShipToName, @ShipToAddress, @ShipToCity, @ShipToStateOrProvince, @ShipToZipOrPostalCode, @ShipToCountry, @ShipToPhone, @ShipToFax, @SupplierQuoteNo, @Terms, @OriginatedBy, @RequiredDate, @ShipVia, @ShippingTerms, @FOBPoint, @PSTExemptionNumber, @ReferenceNumber, @ReferenceDescription, @SubTotal, @GST, @PST, @Total, @SIMSDS, @SIOutsourcedProduction, @SIIntercompanyTransaction, @SIConfirmationOnly, @SIMaterialCertification, @ApprovedBy, @ItemDPartNumber, @ItemDQuantity, @ItemDDescription, @ItemDUnit, @ItemDUnitPrice, @ItemDCurrency, @ItemDExtension, @ItemDGLCode, @ItemBPartNumber, @ItemBQuantity, @ItemBDescription, @ItemBUnit, @ItemBUnitPrice, @ItemBCurrency, @ItemBExtension, @ItemBGLCode, @ItemCPartNumber, @ItemCQuantity, @ItemCDescription, @ItemCUnit, @ItemCUnitPrice, @ItemCCurrency, @ItemCExtension, @ItemCGLCode, @ItemDPartNumber, @ItemDQuantity, @ItemDDescription, @ItemDUnit, @ItemDUnitPrice, @ItemDCurrency, @ItemDExtension, @ItemDGLCode, @ItemEPartNumber, @ItemEQuantity, @ItemEDescription, @ItemEUnit, @ItemEUnitPrice, @ItemECurrency, @ItemEExtension, @ItemEGLCode, @ItemFPartNumber, @ItemFQuantity, @ItemFDescription, @ItemFUnit, @ItemFUnitPrice, @ItemFCurrency, @ItemFExtension, @ItemFGLCode, @ItemGPartNumber, @ItemGQuantity, @ItemGDescription, @ItemGUnit, @ItemGUnitPrice, @ItemGCurrency, @ItemGExtension, @ItemGGLCode, @ItemHPartNumber, @ItemHQuantity, @ItemHDescription, @ItemHUnit, @ItemHUnitPrice, @ItemHCurrency, @ItemHExtension, @ItemHGLCode, @ItemIPartNumber, @ItemIQuantity, @ItemIDescription, @ItemIUnit, @ItemIUnitPrice, @ItemICurrency, @ItemIExtension, @ItemIGLCode, @ItemJPartNumber, @ItemJQuantity, @ItemJDescription, @ItemJUnit, @ItemJUnitPrice, @ItemJCurrency, @ItemJExtension, @ItemJGLCode, @ItemKPartNumber, @ItemKQuantity, @ItemKDescription, @ItemKUnit, @ItemKUnitPrice, @ItemKCurrency, @ItemKExtension, @ItemKGLCode, @ItemLPartNumber, @ItemLQuantity, @ItemLDescription, @ItemLUnit, @ItemLUnitPrice, @ItemLCurrency, @ItemLExtension, @ItemLGLCode, @ItemMPartNumber, @ItemMQuantity, @ItemMDescription, @ItemMUnit, @ItemMUnitPrice, @ItemMCurrency, @ItemMExtension, @ItemMGLCode, @ItemNPartNumber, @ItemNQuantity, @ItemNDescription, @ItemNUnit, @ItemNUnitPrice, @ItemNCurrency, @ItemNExtension, @ItemNGLCode, @ItemOPartNumber, @ItemOQuantity, @ItemODescription, @ItemOUnit, @ItemOUnitPrice, @ItemOCurrency, @ItemOExtension, @ItemOGLCode, @ItemPPartNumber, @ItemPQuantity, @ItemPDescription, @ItemPUnit, @ItemPUnitPrice, @ItemPCurrency, @ItemPExtension, @ItemPGLCode, @ItemQPartNumber, @ItemQQuantity, @ItemQDescription, @ItemQUnit, @ItemQUnitPrice, @ItemQCurrency, @ItemQExtension, @ItemQGLCode, @ItemRPartNumber, @ItemRQuantity, @ItemRDescription, @ItemRUnit, @ItemRUnitPrice, @ItemRCurrency, @ItemRExtension, @ItemRGLCode)"
Comment