使用bat文件更新访问表中的字段 [英] Update a field in access table using a bat file

查看:61
本文介绍了使用bat文件更新访问表中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行使用访问数据库的应用程序。



此数据库存储在映射的网络文件夹中,由多台客户端计算机使用。



我想在从每个客户端工作站运行应用程序之前更新访问数据库中的字段。



我想从批处理文件中执行此操作,我将首先在访问数据库中执行更新,然后在批处理文件中启动应用程序。



这样我将在每个客户端上创建一个批处理文件,并根据客户端更改更新字段的内容,除非有一个简单的方法。



请让我知道如何去做这个。



提前致谢



我的尝试:



i已尝试在数据库中运行宏但它无法正常工作

I am running a application that uses a access database.

This database is stored in a mapped network folder and is used by more than 1 client machine.

I want to update a field in the access database before running the application from each client workstation.

I want to do it from a batch file where I will first perform an update in the access database and then start the application in the batch file.

This way I will create a batch file on each client and change the content of the update field based on the client unless if there is an easy way out.

Please let me know how to do this.

Thanks in advance

What I have tried:

i have tried running a macro in database but it is not working

推荐答案

不要尝试使用批处理文件 - 没有必要,它会导致问题。例如,要使用它,必须在每台计算机上安装Access - 最好避免使用,因为用户可以直接访问数据库,而不是通过批处理文件/您的应用程序。

您可以编写一个小的伴侣应用程序,它可以通过批处理文件执行您想要的操作(它也可以在最后启动您的应用程序),但更好的解决方案是将该功能添加到启动您的应用的代码。请记住,您的应用程序可以为其安装的每台PC提供单独的设置文件。

但我认为您正在为自己设置问题,但使用Access文件。在多用户环境中访问并不好(尽管可以使用它) - 它主要是单个用户数据库,当我试图破坏它时,我总是遇到烦人的间歇性问题。如果您在同一个数据库上拥有多个用户,则确实需要查看基于服务器的系统,例如SQL Server或MySQL。从长远来看,你真的会为自己省去很多工作(而且来自痛苦的世界)。
Don't try to use a batch file - it isn't necessary and it causes problems. For example, to use it, Access would have to be installed on each computer - which it would be best to avoid as the user would then have direct access to the DB instead of via the batch file / your application.
You could write a small "companion app" which does just what you want to do via the batch file (and it could start your app at the end as well), but a better solution is to add the function to the startup code for your app. Remember that your app can have individual settings files for each PC it is installed on.
But I think you are setting yourself up for problems anyway but using an Access file. Access isn't good in a multi-user environment (although it is possible to use it) - it's primarily a single user database and I've always had annoying intermittent problems when I try to subvert that. If you are having multiple users on the same DB, you really need to look at a server-based system such as SQL Server or MySQL. You really will save yourself a a lot of work (and from a world of pain) in the long term.


这篇关于使用bat文件更新访问表中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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