Skip to main content

Search

Search

Which Event Adodb Database Connection?

Comments

4 comments

  • Avatar
    Shotaro Ito
    Dear Kiat,

    1) If you want to take value from prompt input then update label's substrings, place script to "OnPostPropmt" event of Object datasource.
    (There's no way to [b]update[/b] prompt text responding to prompt input, so you have to update value [u]after[/u] prompt closed)

    2) Enable "Automatically print again" in Print dialog's Option minitab, so after print, it return to user prompt(or query prompt) again.

    3) Trial copy would work fine with Scales. As data is not properly transferred, please check Scale Properties > Connection tab. Make sure serial connection parameters (Baud rate, Data bits, Parity, Stop bits and flow control) are properly matches with Scale's port settings.
    Try connecting via Hyper Terminal or any terminal software, to make sure the PC is able to connect to the scale properly.

    Hope that helps!
    0
  • Avatar
    Legacy Poster
    Thank you Shotaro san. I followed your advice and it worked.

    I have a question about using VB Script on Bartender...

    What is the difference "Functions and Subs" and "OnProcessData" inside More Options > VB Scripting... versus.. "Multi-Line Line Script" and "Event Control Scripts" inside VB Script, when we specify the Substring source ?

    I noticed that (in previous occasions) the database actually got updated several times in succession (same data) when using VB Script. Similarly I am getting a test MsgBox pop up so many times. Like as if there is some kind of encapsulation of classes. And I am not exactly sure whic class is being executed.

    If so.. is there a precedence in VB Scripting in Bartender, which class (and/or events) gets executed first?

    (also btw... whenever I insert a MsgBox in a code for test, and click on OK to exit object property, Bartender would execute the MsgBox several times, and when I try to enter the object property again, Bartender executes MsgBox again repeatedly, and then freezes, and restarts, without saving the btw file.)
    0
  • Avatar
    Shotaro Ito
    Dear Kiat,
    Frankly speaking, I don't have deep knowledge of VB Script of BarTender.
    You can get some info from BarTender's online help > Visual Basic Scripting - unfortunately there's not much detail about what you've asked.

    There's Substring level VB script and Format Level VB script.

    About Substing level VB Script, what I can tell in my rough recognition is,

    - Single line expression / Multi line script
    Works as datasource, creation of substring data.
    Single line expression
    [code]"Hello world"[/code]
    is equal to Multi line script
    [code]Value = "Hello world"[/code]
    (it looks these scripts executed in several times in a print job)

    - Event control script
    Works as datasource, runs at specified occasion.
    You can set multiple event to single substring, such as "OnPrePrompt" to pre-enter prompt data,
    then "OnPostPrompt" to process after prompt input.
    Default Value shown in design view is defined in "OnAutoSelectedEvent".

    - OnProcessData in More options VB Script
    Works as post processing of datasource. You can modify input data - such as Database field, User prompt input etc.
    datasource is referenced by keyword "Value".
    [code]'Format number by comma separator (1000 to 1,000)
    If IsNumeric(Value) Then Value = FormatNumber(Value, 0) [/code]

    - Functions and Subs
    You can place Functions and Subs in here for repeatedly used process in the a substring.
    Datasource's Functions and Subs are not format global.
    That means, if you want to use the same Function in many text objects,
    you have to place the same Function on each text's datasource.

    You can set VB Script to populate dropdown list's options, and Modify data in Query Prompt input too.

    (Guys, please tell me if you know more detail about this.)

    About Format Level VB Script,
    It is able to control object's property such as Box's fillcolor, font size or barcode location etc.
    Format level VB Script is new function from BarTender 9.3 and only available from Automation edition or above.
    [url="http://s3.amazonaws.com/SeagullBarTender/ftp/WhitePapers/WhitePaper_DynamicallyChangingObjectsAtPrint-TimeUsingVBScript.pdf "]WhitePaper:Dynamically Changing Objects At Print-Time Using VBScript[/url]

    About your crash of BarTender, the object might be broken. if you repeatedly have that problem, delete the object (Text, barcode etc) and create the same object again, then apply the script.
    If you have certain reproducible pattern and that prevent you to create desired format, please contact to Technical support with the format attached.

    Hope that helps!
    0
  • Avatar
    Legacy Poster
    Thank you Shotaro san for your prompt reply.

    I hope Seagull can provide us with more information about how VB scripting works inside Bartender.

    What happenned yesterday, when I tried to read (and print) address record onto a label, (test) I placed some codes inside Multiline scripts, it prints, but on printing 2nd label onwards, it prints the previous record (even though I am using a WHERE clause in my SQL), and it prints the address twice on the same label too (giving me the hint that the code is executed twice). But when I place the [u]same [/u]code inside Screen Data VB Scripting, it works as expected. So I am confused about how these classes works.

    I also have this problem, when I transfer the btw file from one Bartender client and use on another Bartender client, make some modifications to that btw file, to change data source and delete some of the previous objects, save the btw file, but it still "remembers" the previous datasource and picture object. It keeps appearing as error message saying previous database field not found when printing (even though I have saved the object numerous times).
    I am just wondering if there is any command lines to refresh/regenerate the btw file, to clean up the old object reference inside the btw file.

    Anyway, I will investigate more about how the code behaves inside Bartender.

    Thank you again.
    0

Please sign in to leave a comment.