Refreshing Database Immediately after Print 追蹤

0
Avatar
Christian Vargas

I need to do the following:

 

-- OnPrintJobEnd

  -- Refresh Existing Database Connection Immediately

 

* The reason this is needed is because after a print, the template I have exports a TXT file, and my SQL server then immediately uses that TXT file to update the Database the Template is pulling from. So it needs to see the changes that the database updates with immediately after each print.

4 意見

0
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.

登入寫評論。