Check If Field Name Exists In Db
is there a way to check if a field exists in the databas, in a script ?
we are using a TEXT file and first row as field names. but sometimes the field names are a bit different (2 separate programs are using one label design, and producing the text file a bit different
Yon
-
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 -
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 -
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 FunctionNote that BarTender has a full set of VB script documentation help found via the "Help" menu in BarTender.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare