开发者

ms-access: doing repetitive processes with vba/sql

开发者 https://www.devze.com 2023-03-09 14:29 出处:网络
i have an access database backend that contains three tables. i have d开发者_运维问答istributed the front end to several users. this is a very simple database with minimal functionality. i need to imp

i have an access database backend that contains three tables. i have d开发者_运维问答istributed the front end to several users. this is a very simple database with minimal functionality. i need to import certain rows from a file every hour into one of the tables in the database. i would like to know what is the best way to automate this process so that i can have it running hourly. i need it to be running sort of as a service in the background. can you tell me how you would do this?


You could have for example:

  • a ms-access file with all necessary code to run the import proc
  • a BAT file containing the command line(s) that will run this ms-access file with all requested parameters. Check ms-access command line parameters to see the available options.
  • a task scheduler service software to launch the BAT file: depending on the task scheduler and the command line to be sent, you could even avoid the BAT file step


If all you want to do is run some queries, I would not do this by automating all of Access, but instead by writing a VBScript that uses DAO to execute the SQL directly. That's a much more efficient way to do it, and will run without a console logon (which may or may not be required for full Access to be run by the task scheduler).

0

精彩评论

暂无评论...
验证码 换一张
取 消