Update Sql Db After All Records Have Been Printed Follow
i have a c# app that sends a command line to bartender to print labels
is there a way to configure the labels to update the corresponding record in the database, but only if the print job has been completed ?
i have tried putting a vb script in OnPrintEnd event but the DB updates automatically
whether the label was printed or not
thanks in advance!
here is my vb script:
'Define the object names.
'Define the database connection parameter constants.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
'Get the id of the current printed record (another barcode with record id)
id = Format.Objects("Bar Code 4").Value
'Connect to the sql DB.
Set objConn = CreateObject("ADODB.Connection")
objConn.Open "Provider=SQLOLEDB;Data Source=myDataSource;Initial Catalog=myDB;Persist Security Info=True;user id=myid;password=mypass;"
'Create a record set of one record which is the current record being printed.
Set rs = CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM [tbl_Bartender] where ID= '" & id & "'", objConn, adOpenStatic, adLockOptimistic, adCmdText
if not rs.eof then
rs.Fields("Comment") = "YES"
Please sign in to leave a comment.