Avatar of HKFuey
HKFuey
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

Access SQL stored procedure error

Access VBA SQL Stored Procedure error.

I can run this on the server:

Update TransactionCode Set ParameterXML = '<StockTake xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="INVTSCDOC.XSD"><Key><WarehouseCode>XX</WarehouseCode></Key><Option><CreateBins>N</CreateBins><CreateSerials>N</CreateSerials><CreateLots>N</CreateLots><ValidateReturnsAll>N</ValidateReturnsAll><ValidateOnly>N</ValidateOnly><IgnoreOtherWhsItems>Y</IgnoreOtherWhsItems><CaptureTicketNumbers>N</CaptureTicketNumbers><TicketNumbersExist>N</TicketNumbersExist><DefaultCaptureMethod>I</DefaultCaptureMethod><XslStylesheet/></Option></StockTake>' Where TransCodeID = 23

When I run this in Access:
SQLUpdate = "Update TransactionCode Set ParameterXML = '" & XMLstr & "' Where TransCodeID = 23"

        objCmd.CommandText = "Exec usp_ExecuteSQL" & " '""" & SQLUpdate & """'"
        objCmd.ActiveConnection = adoConn_Dataswitch
        Set objRs = objCmd.Execute

I get "Incorrect syntax near '<' "

Can anyone help?
Microsoft AccessVBASQL

Avatar of undefined
Last Comment
HKFuey

8/22/2022 - Mon