469,931 Members | 2,694 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,931 developers. It's quick & easy.

Accessing external functions from Access...

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.

Oct 4 '06 #1
1 1634
Couldn't you port the parser to VBA? I do have a syntax checker for [a
grammar that can be put in a table], if you want to use that, flag me.

A shell call doesn't return a value from the program you call; it
doesn't even wait for that program to complete. Best bet is to use a
semaphore: your parser should write some file, of which VBA can check
the presence (presumably in a Timer event procedure so it won't lock up
your computer)

Lyndon schreef:
Hi all,

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.
--
Bas Cost Budde
Holland
www.heuveltop.nl/BasCB/msac_index.html
Oct 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Gary | last post: by
8 posts views Thread by Scott Allen | last post: by
47 posts views Thread by Richard Hayden | last post: by
4 posts views Thread by Eugen Walcher | last post: by
3 posts views Thread by Frederick Gotham | last post: by
21 posts views Thread by Hallvard B Furuseth | last post: by
1 post views Thread by =?Utf-8?B?R2FldGFub0c=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.