Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I want to delete a table from an Access database using a batch file.

Any ideas?
Posted
Updated 6-Nov-12 1:38am
v3

1 solution

You would need to add a DeleteTable macro to it. You could then use the Command to read the given commandline argument, which would be the table name in this case. Try add a macro something like this:
Public Sub DropTable()
  On Error Resume Next
  DoCmd.RunSQL "DROP TABLE " & Command
End Sub


Call it from the commandline something like this:
Msaccess.exe test.mdb" /x "DropTable" /cmd "MyTable"

Good luck!
 
Share this answer
 
Comments
PRAKASH_N 7-Nov-12 4:01am    
Thank U....
Maciej Los 15-Apr-13 5:50am    
+5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900