Change Access link from SQL Server to another Access file? - sql-server

I've seen lots of questions regarding moving data from Access to SQL Server, but I'd like to go the other route. Here's why:
I've been working on a sizable project with a SQL Server 2008 back-end and Access 2007 front-end. I'd like to be able to do some work on the front-end from home over the weekend, but I don't have access (VPN or otherwise) to SQL Server from there. I'd like to change my linked tables from SQL Server to another Access database file where I imported a snapshot of the SQL Server data. Then, come Monday morning, switch links back to SQL Server.
My problem is when I go to the Linked Table Manager and attempt to change the link, all I get is the ODBC Select Data Source dialog. If I try to link to an Access database, it tells me ODBC can't be used to link, import or export to another Access file.
One thought has occurred to me but I haven't tried yet; maybe someone could tell me if it's a good or bad idea: would I be able to delete the links, re-create them to the other Access file, and not lose any functionality in my queries/forms/reports?

My proposal would be to have SQLExpress (free) installed on your computer. You can then have all the data available on the machine. Create a publication on your main server, and have your local machine suscribe to this replication (if you don't need to save/synchronize the data changes done on your machine, you can stick to a basic 'snapshot' replication.)
You then just have to change your connection string from your network MSSQLSERVER to your localhost SQLEXPRESS server instance to have your app work.
If, for any reasons, you have to make changes to the database model while being off-line, you will then have to unsubscribe from the main server before making the changes on the local server. When you're back to the office, make sure that the same changes are done on the main server. My advice is to write your changes in T-SQL, save them in a file, and launch the file against the main server once you're back to work.
My opinion: don't work too much on weekends, or make sure your client is being billed for that.

For linking tables, you need to delete them and entirely and recreate them. Using the linked table manager to refresh ODBC links doesn't even work reliably when you're still using ODBC, as there is data cached in the table link definitions that doesn't get refreshed (e.g., if you change the number of columns in a SQL Server view, refreshing the table link with Linked Table Manager will update the number of columns, but you won't necessarily get an updateable view (assuming the original was updateable)).
But it's not clear whether or not you'll lose functionality or not. That all depends on how much of your application's logic is server-side, in SQL Server views and stored procedures. None of those will work if you link to a Jet back end.

Related

Duplicate localDB under SQL Servers on my laptop

I've been running into an issue recently when I attempt any tutorials that involve using a SQL database, entity framework, dapper, etc.
When it comes time to publish a database, or utilize an ORM, I'm given duplicate options for the same localdb under SQL Servers. Furthermore, then I attempt to publish, the database doesn't show up under the localdb that I've chosen.
I'm wondering how I go about removing the other SQL Servers and just having the one available.
If you look at the image below, the Browse option gives me two of the same LocalDbs. Plus I also get a 3rd one under \ProjectModels. I'm wondering what's causing this and how it can be fixed since no matter which one I choose, the sql database I attempt to publish doesn't show up within any of them.
My advice is not to use this method to publish the database. (right click to delete)
Please refer to this official documentation.
File-based databases like SQLite or SQL Server Express are designed to store their data in easily transferable files that can be served with your application/site.
"Copy to Output Directory" Property of the database file to "Copy if newer". Just point the address to it.
If you are using a server-based database like SQL Server, MySQL, etc., you need to make sure that the target machine/environment has the same database server installed, and you need to write a deployment script to append the pre-populated data files to the server. This might be troublesome for you.
You can also refer to these links. 1,2,3

SQL Server/Access Connection Ongoing Maintenance on Different Server

I am working on building a database through SQL Server. I am going to link it to Microsoft Access so that others can easily view and manipulate the data.
I am only at this place for a temporary amount of time, so I need to make sure that someone else in the office can maintain the database once I am gone. If I am only able to use my own personal computer server, is there any way for me to send the entirety of my work to someone else? Or will they have to recreate everything on their own server?

Write Access Client App for SQL Server 2005 Backend

I'm writing an inventory/payroll system, and I'm storing all the records on a remote server running SQL Server 2005 on Windows Server 2008 R2. I was wondering how I could start writing forms(very basic) in MS-ACCESS 2010 to upload things to the database. I just want to test it out to make sure that once I implement the entire database, things will work smoothly and without error. I want to figure out how to just make a single form that will be connected to the database, right now the form will just be a simple single text input with a submit button, that will be uploading barcodes(strings not images).
If I need to clarify anything, please just ask.
Thanks in advance for any help
Microsoft has tons of useful "Getting Started" articles.
This one explains how to connect to SQL Server: http://office.microsoft.com/en-us/access-help/import-or-link-access-to-sql-server-data-HA010341762.aspx
This one covers all sorts of forms: http://office.microsoft.com/en-us/access-help/CH010369205.aspx
Go there, you will find a lot that can help you with whatever you are going to do.
Make sure you have the SQL Client driver installed on the workstation where you'll be using MS Access. You can download it here (look for sqlcnli).
The simplest way to get started is to build an ODBC DSN. Access can then link to your SQL Server tables using that DSN. How to Create a DSN
In Access, Go to the "External Data" option and choose ODBC. Locate your DSN and then select which tables you want Access to be linked to.
After your linked tables are showing up in the tables list, click on one of the tables, go to the Create tab (2007, not sure about 2010) and choose Form. This should automatically create a form for you using the table you had selected when you clicked the Form button. There's no need to write code or add buttons to this form. The default form can do all CRUD operations as long as permissions for all CRUD have been granted to the username you used when you created your DSN.
Some developers prefer to use ADO (code only, no linked tables or form wizards) or Pass Through Queries to access SQL Server from Access. I can't really tell you what you should be using because it depends on so many different factors including (but not limited to) size of project, amount of records, skill level, personal preferences, etc.

Strategies for distributing SQL-server-based application

I have written an application in vb.net, based on SSCE. Now I need to shift in SQL Server Express because I need to run the application on Sharing (LAN) and several users need to access the database at the same time.
I am absolutely new to SQL Server. I need to know the following:
1) Do I create SQL Server DB by Adding New Item in my VS 2008? or they need to be created in SQL Server mgmt Express ONLY?
2) How do I distribute these database, same way like SSCE databses?
3) Can these databases be used like we use Access DBs in sharing (just put in the shared folder)?
4) If no to Question 3, how to set the connection string as I donot know the name of computer of the user who will install my application.
Thanks
To create a new database, the easiest thing would probably be to do
into SQL Server Management studio, open the instance of SQL Server
where the database will live, right click on the "Databases" folder
and select "New Database...". Once the database is there you can add tables and the like.
You will not distribute this database. Instead you will include a
connection string in your application that references this DB. All
data will live on a single instance.
No, you will not share this like you shared an Access Database. One
problem I have with Access is that the untrained masses are set
loose on the database to do as they please. I would give as few
people as possible access to the database. And when you give them access limit their permissions to the bare minimum they need. If you want someone to
change the data in there create an application that allows them to
modify table records as you see fit.
Take a look at this link for an explanation of how you should setup
your connection string. The connection string itself will not vary
between machines. You will just need to use the appropriate account
that has the appropriate access to the DB. You will also need to
make sure that the server where the DB is running is accessible.
Good luck!

Updating database on website from another data store

I have a client who owns a business with a handful of employees. He has a product website that has several hundred static product pages that are updated periodically via FTP.
We want to change this to a data-driven website, but the database (which will be hosted at an ISP) will have to be updated from data on my client's servers.
How best to do this on a shoestring? Can the database be hot-swapped via FTP, or do we need to build a web service we can push changes to?
Ask the ISP about the options. Some ISPs allow you to ftp upload the .mdf (database file).
Some will allow you to connect with SQL management studio.
some will allow both.
you gotta ask the ISP.
Last time I did this we created XML documents that were ftp'd to the website. We had an admin page that would clear out the old data by running some stored procs to truncate tables then import the xml docs to the sql tables.
Since we didn't have the whole server to ourselves, there was no access to SQL Server DTS to schedule this stuff.
There is a Database Publishing Wizard from MS which will take all your data and create a SQL file that can then be run on the ISP. It will also, though I've never tried it, go directly to an ISP database. There is an option button on one of the wizard screens that does it.
it does require the user to have a little training and it's still a manual process so mabe not what you're after but i think it will do the job.
Long-term, building a service to upload the data is probably the cleanest solution as the app can now control it's import procedures. You could go grossly simple with this and just have the local copy dump some sort of XML that the app could read, making it not much harder than uploading the file while still in the automatable category. Having this import procedure would also help with development as you now have an automated and repeatable way to sync data.
This is what I usually do:
You could use a tool like Red-Gate's SQL Data Compere to do this. The tool compares data between two catalogs (on same or different servers) and generates a script for syncing them.

Resources