Solved

SQL Server to Microsoft Access data transfer

Posted on 2011-03-23
4
244 Views
Last Modified: 2012-05-11
We just added an old (NT 4.0 Workstation) computer to our business network as it powers a large Chop saw in our factory.  The saw operates via a software program that runs on the PC that access a local MS Access database on the C drive.

We want to populate the access database from a 2008 SQL Server with data on a daily basis (small amount of data - say 200 records.  These records are currently inputted by hand via the software program on the PC).  What is the best method? Can the SQLServer talk directly to the access database on the Nt Workstation? i have confirmed that there is no security on the access database
0
Comment
Question by:Bekster
  • 2
4 Comments
 
LVL 6

Expert Comment

by:ahdfx
ID: 35202658
I would say the best way would be to write a small application that would read the data off the SQL database, then do SQL queries into the Access DB.

Another option would be to export the data to a flat file (csv) then import that into Access.
0
 
LVL 84
ID: 35202669
Access can "link" the tables on the server database in most cases (assuming you have the correct drivers, etc). Once you "link" the tables, you can work with them as if they were local Access tables to a great extent.

As to populating the tables - you can do that with several methods, but the simplest is to use standard SQL to do this:

INSERT INTO YourSQLTable(Col1, Col2, Col3) Values(Val1, Val2, Val3)

That is quite simplistic, but that's the basics.

Where does the daily data load come from? Is this something generated by another program, or is this human-created data?
0
 

Author Comment

by:Bekster
ID: 35207190
The data is created from within the SQL Server, it will be available in a table every day (think a listing of larts needed base on the days order entry)
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 35209012
If the table and fields are constant (i.e. the tablename is the same, and the Fields in both the SQL Server and Access tables are the same), then just use an INSERT query to do it.

First, link the SQL table into the Access database. Use File - External Data - Link, then create a new ODBC data link. Once you do that, you'll see a list of the tables available in your SQL database. Choose the relevant tables, and your link will be created.

Now just use regular SQL to build an INSERT statement. You could do this on the click of a button, perhaps:

Currentdb.Execute "INSERT INTO YourLocalAccessTable(Col1, Col2, Col3) SELECT Col1, Col2, Col3 FROM YourLinkedSQLTable"

If you need to "clear out" the Access table first:

Currentdb.Execute "DELETE * FROM YourLocalAccessTable"
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question