简体   繁体   中英

Import SQL Data to MS Access 2007 Database using Access Forms

I'm working on a mini-project at work:

I need to Import data from SQL server 2008 to Access 2007 so that an end user can access the data/run reports etc.

Things I am not allowed to do:

I am not allowed to link the data [ don't want the end user running queries on the SQL server database which is live ]

I am not allowed to create a SQL task/SQL job/SSIS package to do this nor am I allowed to write a little application in C#/VB.NET etc.

Things I can do:

I'm only allowed to create an Access form which copies data from the SQL server database to a local Access DB on a button click.

I must store the connection string in an inaccessible place so that the end user cannot see it/edit it

Things I've tried

I've tried to use the "External Data Import" manually and that works just fine but creates a new table every time I run it [ Something like MyTable1 , MyTable2 ].

I can't seem to find any sources that concisely describe how I could automate this [save for the button click].

I would like for someone to point me to resources or help me figure this out. I am not looking for someone to write code for me . I just don't know where to start.

You might look into using the "TransferDatabase" method. It allows you to import and export data from outside data sources. You could get to a sql server using ODBC. See:

https://msdn.microsoft.com/en-us/library/office/ff196455.aspx

Also, if you don't want users to get easy access to your connection string, you can publish it as an MDE file so they can not see the code. But the connection string isn't encrypted... so it's not unhackable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM