Hi all,
I am developing an Access database application that requires some
additional, non-database related functionality. This additional
functionality is essentially to validate a flat text file provided by
an external data provider. I am proposing to add a button to one of
the forms in my application to perform this validation and then pop up
a message box indicating whether the flat file is valid or not. This
is in preference to building a separate application just to validate
the flat file.
My inital idea was to code the validation using VBA code behind the
form, to read the flat file line by line and check the syntax of the
data fields in each position. However, upon inspection the flat file
is more complex than I expected so I need to do something else. I have
used lexical parsers in the past for scaning and validating complex
flat files and this seems to be the perfect solution, however I am
unsure which path to pursue as far as linking an external module into
my VBA application. The parser will be generated in Java so I have the
option of linking my parser class files to my VBA application and
calling them that way or I could compile the parser classes into native
code and use shell calls within Access to invoke the EXE. I have not
done either of these things using VBA but I've looked on the net and
both options seem viable, I'm not sure which is the best approach in
this situation.
In my past experience with Java parsers, they have always been called
from a Java application, so I can pass a text file to the parser class
and it returns a boolean for pass or fail. If I call an EXE (my
natively compiled Java class) will I get this return value back in my
VBA application..? I have thought about creating the parser as a DLL
which would link to my VBA applicaiton but don't have much experience
with this approach either so I'm not sure if it's possible in this
situation.
I have no problems getting the parser to work or completing the VBA
application, my weakness at this point is integrating the two. Any
suggestions or advice would be most appreciated.
Many thanks and regards,
Lyndon.