Update via VB Script SQL database from the records used to print labels S’abonner

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" )
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 &"' "




2 commentaires

Pete Thane
Actions pour les commentaires Permalien

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

xi men
Actions pour les commentaires Permalien

I am running Bartender 2019 R2 version. This problem still exists. What is the reason for this?

Print the data in the selected recorder and update its database value,

Dim ordno
Set objConn = CreateObject("ADODB.Connection")
set rs = createobject("adodb.recordset")
connstr="DSN=SQL Anywhere 11 Demo;UID=dba;PWD=sql"
objConn.Open connstr

SQL ="UPDATE products set name='print_oK' where description='" & ordno & "'"

objConn.execute SQL

Why is this statement not updated, is it caused by the assignment of the selected value?
If you write him as a value, you can successfully execute and update the database without any problem.
SQL ="UPDATE products set name='print_oK' where description='V-neck"

Vous devez vous connecter pour laisser un commentaire.