Hi Kotireddy,
You can't do this directly from a batch file. You need to use commands
in the batch file that call other programs to do the work.
One approach is (1) create a VBA procedure in the Access database that
does whatever it is that you want; (2) create a macro that calls the VBA
procedure. Then (3) you can call Access from the batch file, using the
/x switch to pass the name of the macro. See "Startup command-line
options" in Access help for more information.
If the task is simple and you're not familiar with VBA, it may be easier
to omit the VBA procedure and include all the commands in the macro.
Another is to use an OLE-compatible scripting language (such as
VBScript, Perl or JavaScript). Either write a script that does what's
needed with the database and call it from your batch file, or else write
a script that replaces the batch file entirely. In this case one may not
actually need to use Access itself: it's often simpler to use the DAO
object model to work with the Jet database engine and the MDB file than
to program Access. But it depends on just what you're trying to do.
If you're considering serious automated operation of Access, read these
articles first:
Using Microsoft Access as an Automation Server
http://support.microsoft.com/?id=147816
http://support.microsoft.com/?id=210111 (Access 2000 and later)
Considerations for Server-Side Automation of Office:
http://support.microsoft.com/?id=257757
Configure Office Applications to Run Under a Specific User Account
http://support.microsoft.com/?id=288367