When Access is operating as a DDE SERVER there is no easy method to send requests to Access asking it to execute Access Basic functions. There is a KB article which offers a method by embedding the function call inside a SELECT statement, however if you want to do repeated calls this method can eat up resources, in addition some DoCmd Actions are invalid and you also need an empty table in your database.
The attached files offer a COMPLETE solution to the problem. The CLIENT allocates a chunk of GLOBAL memory for passing information to the SERVER, in this case Access. The first time Access is loaded a handle to the GLOBAL memory is passed as a command line argument. It would be possible to pass the address directly but this would limit VB to what it could do with the memory.
The global memory is used to pass the function call and any arguments accross to Access. The DDE module in Access then executes the function by doing an Eval on the contents of global memory.
Currently I have not implemented a mechanism for passing back any information from Access to Visual Basic, mainly because I don't have a need for that functionality!
DDE.TXT is required in you Access database as a module.
DDE.BAS & DDE.FRM are required in the VB application.
Does any body know a method for determining from VB what are the command line arguments for Access if it is loaded. It should then be possible it determine if the Access that is loaded has information about global memory.
Hope this helps folks, comments welcome!
Mike Tissington (100430,614)
