Solved

SQL Server to Microsoft Access data transfer

Posted on 2011-03-23
4
215 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now