Connect To Db Only On Time Per Print Job Follow

0
Avatar
Legacy Poster

Edition: Enterprise Automation, Version: 9.4 SR3

 

The attached screen shot shows a text field that uses VB script as the datasource.  The script connects to an Access database to retrieve data that is not in the text file database.  The script works fine, but print speed has slowed tremendously.  Before this field was added, the labels printed continuously, without pausing between labels.  Now, there is a one to two second pause between each label.

 

[attachment=931:bt1.png]

 

My guess is that bartender must connect/disconnect from the db for each label that prints, causing the slow print speed.  If so, is there a way to have bartender connect to the db at the start of the print job and keep it open until the job has ended?

 

I tried to connect to the db in the "OnPrintJobStart" event and then update and read the recordset using vb script in the datasource of the text file, but that did not work.

 

Thanks,

Steve

2 comments

0
Avatar
Legacy Poster
Comment actions Permalink

I also tried to use Event Controls Scripts instead of Multi-Line Script.  I put the code that connects to the db in the "OnPrintStart" event and then put the code that updates and reads the recordset in the "OnNewRecord" event.  The code runs, but nothing is printed on the label.  I assume that the recordset variable that was declared in OnPrintStart is not accessible in the OnNewRecord event.  Attached is the label format.  The field in question is named "Text 9" and shows <Empty> just below the "WIP Cart-Slot" field heading.

 

Am I stuck with connecting to the database for each label that prints?
 

0
Avatar
Michael Toupin (mtoupin
Comment actions Permalink

Unfortunately that appears to be the issue.  There's not a way to maintain the database connection across multiple labels if you're using it in VB, every label is going to require a refresh of the VB script or it's only going to print the initial result.

Please sign in to leave a comment.