Skip to main content

Search

Search

Check If Field Name Exists In Db

Comments

3 comments

  • Avatar
    Ian Cummings
    Moderator

    This can be done externally to BarTender via one of the automation interfaces, but I'm not sure of a way to do this internally to BarTender via a VB script.  Sorry.  Anyone else got any ideas?

    0
  • Avatar
    Legacy Poster

    How about reading in the first xx amount of bytes from the TEXT file to a string (the first row is the field names) and then see if that field is part of the string  

    How would this be done in the VB script 

    0
  • Avatar
    Ian Cummings
    Moderator

    I guess that is feasible using the ReadLine method of the File System Object in VB script.  See the below example:

    Function ReadLineTextFile
     Const ForReading = 1, ForWriting = 2
     Dim fso, MyFile   Set fso = CreateObject("Scripting.FileSystemObject")
     Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForReading)
     ReadLineTextFile = MyFile.ReadLine
    End Function
    

    Note that BarTender has a full set of VB script documentation help found via the "Help" menu in BarTender.

    0

Please sign in to leave a comment.