Update via VB Script SQL database from the records used to print labels 关注
I am trying to update all the records I just printed labels for.
My table is t_hjship_request_pkg
Key value is hjship_shipment_id
In my initial bartender select I include the hjship_shipment_id
Now I want to update all t_hjship_request_pkg where hjship_shipment_id IN (Result values in bartenter)
I can connnect to the DB and manually write an update and hard code value and it works.
But I want to pull values from the Result set in bartender to do my updates.
Is this possible?
I have tried referencing FIELD("AAD.t_hjship_request_pkg.shipment_id") but the double quotes are causing issues with the statement
Const DB_CONNECT_STRING = "Provider=SQLOLEDB.1;Data Source=DEV-HJSQL2;Initial Catalog=AAD;user id ='HJS';password='HJSPASS#1'"
Set myConn = CreateObject("ADODB.Connection")
Set myCommand = CreateObject("ADODB.Command" )
Set myCommand.ActiveConnection = myConn
SET Mystr = Field("AAD.t_hjship_request_pkg.shipment_id").Value
myCommand.CommandText = "UPDATE t_hjship_request_pkg SET printin_status = 'P' Where printing_status = 'T' and hjship_shipment_id = '" & Mystr &"' "