简体   繁体   中英

MS Access Linked Tables to SQL Server

I have looked into "How to get MS Access Linked Tables to SQL Server", however, I didn't find any results that applied to my situation.

I am upgrading a database( db1 ) from MS Access to SQL Server. I'm needing to get the linked tables from db1 into SQL Server(2016).

Is there somehow a way to move the linked table connection to my SQL Server? The linked tables I currently have are from one Access database to another Access database.

Note: The linked tables in db1 are to another MS Access (2007) database.

Access "links" SQL Server tables by opening a connection to SQL Server and performing whatever tasks it needs to, like SELECT, INSERT, UPDATE, etc.

If you're talking about going the other way, there is no "reverse" functionality where SQL Server will open up an Access database to perform queries.

If you just need to import the data from Access to SQL Server, right click on your database and select Tasks, then select "Import Data".

Edit: Creating a linked server on SQL with Access apparently is possible, however given that Access locking isn't designed for any significant amount of concurrency, I'd still recommend against it, unless this is just a one time thing.

Well, you probably have your work cut out for you. If your Access DB isn't too complex, the Upsize wizard may do some of the work for you.

https://support.office.com/en-us/article/move-access-data-to-a-sql-server-database-by-using-the-upsizing-wizard-5d74c0df-c8cd-4867-8d07-e6e759d72924

However, if your DB is somewhat complex, and I'm guessing it is, the Upsize wizard won't help much. The Wizard definitely won't handle the Forms and Reports; those are very specific to Access. The SQL will be different, but probably only slightly different. There are probably a bunch of ways to approach this. One that comes to mind is the possibility of exporting all tables in Access, as CSV files, and then bulk loading those CSV files into SQL Server. That, at least, would get the data loaded into the schema. Then you can start rebuilding the queries. Well, just do one step at a time.

'    VBA to run in Access
Option Compare Database

Private Sub Command0_Click()

Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllTables
If Left(obj.Name, 4) <> "MSys" Then
DoCmd.TransferText acExportDelim, , obj.Name, obj.Name & ".csv", True
'DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, obj.Name, obj.Name & ".xls", True
End If
Next obj

End Sub

That should get you going, I think. Post back if you have additional questions or need some additional clarity about this concept. Again, there are probably may approaches to this issue. This is just one thing that comes to mind.

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