Skip to main content

Search

Search

Refreshing Database Immediately after Print

Comments

4 comments

  • Avatar
    Shotaro Ito

    Database field value will be refreshed at every print job. (it doesn't use cache from previous print etc)

    Besides there's no control to current BarTender document's database connection from VB Script.

    0
  • Avatar
    Christian Vargas

    Is there a way to force the template to wait 10 seconds after a print before displaying the form again. 

     

    The reason I ask is because the print itself exports a csv file after printing, then this csv file is used by SQL to update a Handling Unit Count in the very database that the template is using to pull from. The issue I see is that it takes about 10 seconds for SQL to copy the data from csv to that table, but the form comes back up before it is able to do that. So the data it displays for the next print is not yet updated. 

    0
  • Avatar
    Christian Vargas

    I was able to solve this by serializing the count, but then setting it to reset to the latest value that is on the database when it finally detects a change in that database. Now using this way, while it sends the csv file to the SQL database as it prints, I also get an immediate update to the count because of the serialization so that subsequent prints are using the correct count, but when the database finally updates, it periodically syncs with the database's count. Final effect being that I get immediate count updates while printing, but when I pull up the order again later it pulls up the current count it was left at last. 

     

    Solved :-)

    0
  • Avatar
    Shotaro Ito

    Smart! Thanks for the sharing.

    0

Please sign in to leave a comment.