Moving Access 2016 application's data from Access to SQL Server 2016 - migration

I have a seemingly straight forward project, which unexpectedly faces many obstacles.
I need to move backend data of the existing Access 2016 application from Access to SQL Server 2016.
The challenges I face are:
The simplest and recommended way to migrate Access to SQL Server is using Microsoft SQL Server Assistant (SSMA) for Access. The problem is that my Access is 32-bit Click-to-Run edition. Because the target is SQL Server 2016, I should use SSMA for Access v.7.6.0, which is available only in 64-bit. To use it, I need to install 64-bit Access Runtime, which could not be installed, because per the error message “Windows Installer and Click-to-Run editions of Office programs don't get along”. The earlier version of SSMA for Access 6.0 comes in 32-bit and connects to Access fine, but could not connect to SQL Server 2016, as 2014 is the latest version it supports. Ignoring the warning and forcing the connection to SQL Server 2016 causes error collecting data… Thus, I could not use SSMA.
I was able to migrate the data from Access to SQL Server using SSIS. Now, my challenge is to repoint existing Access tables to their SQL Server copies. I was trying link, but it appears that existing Access tables could be linked only to the file system data source. If I try to make link from the SQL Server side, I could only create new linked tables, which do not do me much good as I am trying to avoid massive changes in the application. Could it be that I am missing something simple here?..
Some Access tables have columns of attachment data type. SSIS doesn’t handle attachment data type correctly. To the best of my knowledge, neither does SSMA. So, when I get to link Access tables to SQL Server, I would probably need to write some code to move attachments from the backup Access database to SQL Server. Is there some other an easier solution?
Any suggestions are greatly appreciated.

That is correct. It is a mess. You can use another (virtual) machine with a clean 64-bit Access install.
Delete the current tables in the frontend and link the SQL Server tables. They may be given a "dbo_" prefix which you can remove by renaming the tables.
This is a rewrite. Attachment fields are not supported in SQL Server. Neither are other fancy features like lookup fields and multivalue fields.

Related

Deploying a Windows Form App in C# for multiple users with SQL Server. Alternatives for databases?

I'm working on a database driven program in Visual Studio 2015, in C#, Windows Form Application, and I'm using SQL Server 2014 for my databases, downloaded the most recent version from the MSDN site.
I've got it working well. But if I want other users on other computers and different versions of Windows, this would require them to have SQL Server installed, correct?
Basically the app is used for storing current medications, moods, a mood quiz, symptoms, etc.. and I store all the results in SQL Server databases. They can be edited, deleted, etc through the program's GUI. Do the users need SQL Server installed to use this app?
If so, is there an alternative to keeping databases without having to have the SQL Server connections, or is there a way to do this without the users having to have SQL Server installed? I don't want remote connections to me, I want it standalone.
Does this make any sense? If not, I can explain more. I know way back in the days of Visual Basic 4 I was making, reading and writing databases without SQL. But that was 16 years ago. So I'm wondering what the easiest solution to this is. Thanks!
In other words, you want a database that you can a) distribute to end users freely and b) that will 'connect' just to the copy of the database they have stored locally.
Here are a few options ---
SQLite over ODBC is as-easy-to-use as MSSQL, the driver can be found here:
SQLite ODBC
Use ConfigurationManager.OpenExeConfiguration to read / write your app config .xml file and use it as a key / value store. I can provide examples if needed.
Dynamically create an Access database, it should work as well as MSSQL for most things, with less overhead. Here's how:
Create an Access Database
Use SQLIte DLL. Details on SO
create-sqlite-database-and-table

What does Microsoft SQL Server do?

I understand that this is painfully generic and broad. Nonetheless, all the answers on wikipedia and yahoo (none here that I can find) are pretty useless.
I know T-SQL, C#, etc to some degree. I understand the idea of a database. However, I have NO idea what I created when I made a "server" on my computer through Msft SQL Server. Now I can make databases on that server, and I can connect to them with Visual Studio (sometimes) to use with LINQ or "raw" calls.
Please help me understand (or direct me to an article) of what this myComputerName\SQLEXPRESS (SQL Server xx.x.xxx) thing is. I assume the databases are stored locally...somewhere. SQL Server provides access to the DB files? Why can't they be accessed directly?
Thank you if you even read all this. I really can't narrow the question down.
I guess one specific question is "Can I access the databases without SQL Server running?" Where do I even get the connection string?
You are asking multiple questions, here.
However, I have NO idea what I created when I made a "server" on my
computer through Msft SQL Server. Now I can make databases on that
server, and I can connect to them with Visual Studio (sometimes) to
use with LINQ or "raw" calls.
Please help me understand (or direct me to an article) of what this
myComputerName\SQLEXPRESS (SQL Server xx.x.xxx) thing is.
The layout of a database server is as follows:
Server
Instance a
database aa
database ab
...
Instance b
database ba
database bb
...
...
So, when you install MS SQL Server, you install a MS SQL Server "instance". In this "instance", you can create a number databases. Each database has database files, the exact location of these depends on the settings you chose during installation.
I guess one specific question is "Can I access the databases without
SQL Server running?"
You do not usually open dbf(mdf -ldf) files (the database data files) without MS SQL Server, why would you want to ? You should use the backup/restore features inside MS SQL Server.
Where do I even get the connection string?
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring%28v=vs.110%29.aspx
The "server" is a process/service running on your computer which can be connected to over the network and provides the API to access your database.
"Why can't they be accessed directly?" Is like asking why do I need Word to view Word files, can't I use Notepad for that. Sure you can, but not really.
Another reason is - imagine multiple processes need to access the database. If each reads and writes to the same files, something WILL break if they don't coordinate. Having a separate server process encapsulates all this.
"Can I access the databases without SQL server running?" I mean yes but actually no.
If you want a database that your program accesses directly (or let's say, your program is also the database server in a sense) - then you can use sqlite, or for simple tasks there are also ODBC drivers for CSV, so you can use CSV files as if they were a database. A dedicated SQL server is always better for bigger more complex tasks and data models though.

From Access 2003 to SQL Server 2008?

A client wants to host their MS Access 2003 backend database into SQL Server 2008 that resides in a different server. They will be using upsizing wizard to move their databases and tables into SQL server.
A client also has MS Access front end application written in VB. After upsizing their database tables to SQL, they want to use SQL server to read/write data and also use adv. programmability features of SQL Server like stored Procs, functions etc. My team will host their SQL database.
Client will have a growing # of users entering data. So what would be the best option for our team to provide access to our SQL server so that they can use only their databases in our SQL Server?Is there a way to provide them a connection string or something like that so that they could test it in their front end application to see if they could connect to our SQL Server to read/write?Basically I want to know What are the different avenues to connect MS Access 2003 front end application written in VB to connect to SQL Server database hosted in a different server so that a user could read/write to SQL database tables? Any thoughts? Thanks.
Actually, how this setup works is not any different than if your developers were using c++, vb.net, c# or even asp.net. At the end of the day these software development tools such as c++, or FoxPro or MS Access are simply tools that let you write software. The ability of Access to connect to MySql or Oracle or insert your favorite X database brand has existed from day one.
As long as your database supports what is called "open database connectivity" then you are off to the races. And how you setup that database server to allow some software written in say c# or FoxPro or MS Access will not really change much of anything to my knowledge.
So Access is just like any other software tool such as c++ or vb.net – it is a tool that lets you write code and you connect that application and user interface to some database system you choose.
The connection technology that Access uses here is based on industry standards and thus your setup and maintains of the server side will quite much be the same for any other application(s) that you have running on premises that utilize SQL server now.
About the only relevant issue here is that in Access you have a choice of two data object models, ADO and DAO. Right now, since Microsoft is depreciating ADO and they are continuing investment in DAO and also recommending to use open database connectivity. For example, Access 2010 ships with support baked in for SQL Azure (cloud sql), and that support is based on open database connectivity.
So at this point time as it did back in 2003 the recommend data object model in Access is to use DAO.
You can read about the depreciation of ADO support in SQL server here:
http://blogs.msdn.com/b/sqlnativeclient/archive/2011/08/29/microsoft-is-aligning-with-odbc-for-native-relational-data-access.aspx
While a for good number of general exports and imports and that of linking to SQL server can occur 100% inside of Access, those users will STILL need a set of client tools beyond Access to effectively work with SQL server if over time they going to start using SQL server features. This thus suggests they will need some edition of SSMS (Sql server management studio). The free express version of SSMS should more than suffice in this case.

Partial import of Sql server 2005 database for local developement

So at work, my team is using a central SQL server 2005 database server for integration testing and I want to move to testing on my local database. The only problem is that the central database is in excess of 10 Gb.
I am interested in importing the data objects and a rows for each table to ensure I can be up and running. Can you guys advise me on how I can do this?
I have VS 2008 professional and SQL Server management studio express. Would I need VS 2008 database edition?
Thanks
-Venu
EDIT : I will try logging into the central database server and seeing if the host machine has better tools. Thanks kpollock, I didn't think of that.
Both 2005 and 2008 Express editions have 4 gb limitation.
Have you thought about making a db copy on central server and dealing with it (just restore it into new db with other name)?
See also BACKUP and RESTORE in SQL Server -- Full Backups
Looks like an SSIS job to me - which I think Express version of Management Studio doesn't have.
Or you could do it in C# calling Stored procs on the source database to extract the data if that's where your skills lie. (this is how I would do it as I think it's more widely comprehensible - but that's just my opinion).
If the database is live and new data comes in all the time perhaps you could set up the schema and reference data only then use replication to get the new data as it comes in (if you think that will get you a representative sample).
You will have to code up the sample extraction based upon an understanding of the schema - i.e. ensure you get a full set of linked records (e.g detail records for orders and all lookups e.g. customer, addresses, etc.).

Can SSMA for migrating Access databases to SQL Server 2005 be automated?

I need to migrate Access databases to SQL Server 2005. Since this needs to be done from within a setup so that a customers' installation is transparently migrated to SQL Server 2005, I wonder if it is possible to automate the SSMA toolkit from Microsoft.
Actually SSMA had command-line interface (special console executable in the SSMA installation folder). It was available at some time but I'm not sure whether it made its way to last release. You should ping SSMA support about what versions had it and what examples of its usages are available. I hope this will help you.
To my own knowledge, such an automation is not available. But it is still possible for you to generate the SQL code that creates the database (the one that will begin with the "CREATE DATABASE" sentence) and launch it through your user interface on your SQL server.
To generate this code, you can
Create the access database with the Access toolkit
Generate the corresponing "CREATE DATABASE" SQL code with (for example) SQL Server Management Studio (right-click on database, choose "script database as CREATE". EMS SQL Studio offers a very nice alternative to SQL Server Management Studio
Save the code for further use
With EMS Studio, You can even decide if this code also updates the data. But I'd prefer to automate data transfer through code: you can for example browse the tables (in the right order, depending on relationships), open recordsets (one local, one SQL), and transfer data by browsing the fields (you do not even need to name them) with code like:
(localRecordset links to local table. can be DAO or ADODB; Adjust code accordingly)
(sqlRecordset links to the SQL server. can be DAO or ADODB; Adjust code accordingly)
localRecordset.moveFirst
Do while not localRecordset.EOF
sqlRecordset.addnew
For each field in localrecordset.fields
sqlRecordset.fields(field.name).value = field.value
Next field
sqlRecordset.update
localRecordset.moveNext
Loop