How to have data upload from access to sql server upon opening file

梦想的初衷 提交于 2019-12-25 18:26:24

问题


My form is housing the data I need it to, and I have gotten all the functions corrected. I am trying to figure out a way to get the data from the local access table to auto upload to a sql server db as long as there is an established connection, I was told record sets may be a good way to go. And I tried just linking the table but that is not what my boss is looking for. ANy ideas or direction would be greatly appreciated.

The data housed is employee data, each time it uploads I just need it to push all data regardless if its new or not onto the same table, it will be overwritten. THe data now is saved to a local table whenever the form is filled out, so if it can connect it needs to upload and if it cannot then it just sits and continues to sit on the local table.


回答1:


You need to create the destination table on SQLserver and link it to your access solution as an ODBC connected table. Also create an insert query that writes from your local table to the ODBC table.

Now you simply need to trigger that insert query (for example CurrentDB.execute ) during a fitting event in your form (open, close, before_update etc.).



来源:https://stackoverflow.com/questions/22102538/how-to-have-data-upload-from-access-to-sql-server-upon-opening-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!