批处理文件以从MS Access数据库中删除表 [英] Batch file to delete a table from MS Access Database

查看:106
本文介绍了批处理文件以从MS Access数据库中删除表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我想使用批处理文件从Access数据库中删除表.

有什么想法吗?

Hi Friends,

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

Any ideas?

推荐答案

您需要向其添加DeleteTable宏.然后,您可以使用Command读取给定的命令行参数,在这种情况下,该参数就是表名.尝试添加如下宏:
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



从命令行调用它,如下所示:
Msaccess.exe test.mdb" /x "DropTable" /cmd "MyTable"

祝你好运!



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

Good luck!


这篇关于批处理文件以从MS Access数据库中删除表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆