Update via VB Script SQL database from the records used to print labels フォローする

0
Avatar
Michael Whiting

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" )
myConn.Open DB_CONNECT_STRING
Set myCommand.ActiveConnection = myConn
DIM Mystr
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 &"' "
myCommand.Execute
myConn.Close

 

 

 

1 コメント

0
Avatar
Peter Thane

Sorry this is beyond my programming skills but I believe there maybe something in 2019 (when it is released) that will help out with writing information back into SQL

ログインしてコメントを残してください。