Cannot open Microsoft Access table - sql

I am a beginner in Microsoft Access and one of my friend gave me a copy of his SQL Server file and something with .BAK extension which I believe is the database as it is almost 300MB.
When I try to run the SQL Server file I get cannot connect to backend database error. Searching on the internet I found that I can prevent this by holding shift while opening the database.
Even though this does open the Access file, where I can see all the table,queries, forms, reports and macros icons and names. I cannot open any of them. When I press on one of the table names for example I get
Connection Failed SQL server does not exist or access denied' error.
How do I view the tables?

Your MS Access file is linked to a SQL Server. You basically need to
Install SQL Server Express (it's free)
https://www.microsoft.com/en-au/sql-server/sql-server-editions-express
Restore the .BAK file into SQL Server Express How to import a bak file into SQL Server Express
Relink all of the MS Access linked tables to your installed SQL Server
How does one change the connection string of linked tables in MS Access
This may seem complicated but it is a great opportunity to learn about databases.
Seems your friend is not very helpful.

Related

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

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.

Created .db file using SQL Anywhere - now query it using RazorSQL

I created a .db file using Sybase SQL Anywhere, with loads of tables and information in it. Now, I dont have access to this Software anymore. So I got RazorSQL, which states on its homepage it can query SQL Anywhere. But how can I connect to my .db file using RazorSQL? Because I only found that it can connect to online databases.
Looks like RazorSQL is an application that can connect to various types of databases. You still need a SQL Anywhere server running so that RazorSQL has something to connect to. If you can't run a SQL Anywhere server, you're out of luck.

How do I add records from an Access database into an existing SQL Server database?

I have an existing Access database that has out grown it's usefulness. I have written a Visual Basic program that uses a SQL Server database and have been re-entering the data from the Access file into SQL Server individually.
I still have 300+ records to move and would like to find a way to do all this using either a data snippet in Visual Basic, or using SQL Server Express. I'm smart enough to set up and use Access, and smart enough to create a program and database in Visual Basic and SQL Server but for some reason I not smart enough to move the records between the 2 databases.
When I originally created the .mdf file I attempted to move the records at that time but everything I tried didn't work so I figured I'd get it later, but now I have 300+ records in the .mdf file and need to get the others moved over. Anybody have any ideas?
Easiest thing to do is create your database, then in SSMS's Object Explorer, right click on the database, Tasks -> Import Data ... and go through the Import/Export wizard, selecting MS Access as your source.

Updating a SQL server from a remote .dbf file

I currently have two servers. One is a server with .dbf files that get updated very frequently, and the other is a server with SQL Server workgroup edition on it.
Problem: I need to update the SQL Server tables from these remote .dbf files, how is it done? I need these files to be pulled automatically from the server every X amount of hours.
Research thus far:
I believe I understand how to update tables having the .dbf file on the same server as the SQL Server database, you would use the DTS management studio provided with SQL Server. I don't believe this solution would work trying to pull these .dbf files remotely. I have looked into a Linked Server, but don't understand what that really is. These .dbf files come from a visual foxpro server. As far as i know visual foxpro has no interface like SQL? If anyone has any advice in order to point me into the right direction, this would be much appreciated. I can usually find the answers, but feel pretty helpless on this one... Thanks in advance for any effort put into this problem.
A linked server is basically just a pointer that lets the code within your database interact with external data sources as if they were also within your database/instance. There are some examples here for creating linked servers to FoxPro DBFs:
http://fox.wikis.com/wc.dll?Wiki~VisualFoxProDataFromSQLServer
So for example if you had a linked server to a FoxPro database called MyFoxProDB you could run a query within SQL Server like this:
UPDATE t
SET t.foo = x.bar
FROM dbo.LocalTable AS t
INNER JOIN MyFoxProDB...TableName AS x
ON t.key = x.key;
You could also consider using OPENROWSET as described in this question:
Import DBF files into Sql Server
(But personally I think the linked server will be a lot more flexible.)

Linking SQL 2005 tables in Access (Client file) and distributing to users

I've used the Access 2007 upsizing wizard to move my files to a SQL server. A problem I'm experiencing now is that when I try to link the tables in either Excel or Access, it requires me to create a DSN or a machine data source connection. In either case, when I do this, it makes the connection only useful on the current PC.
What I'm trying to do is create an access file and an excel file, both of which link to the newly upsized tables on the sql server, which I can distribute to users across the network (let's assume they all have sufficient user rights on the SQL server to read data).
Any suggestions?
Chuck
Use Doug Steele's code to convert your DSN's to DSN-less connect strings:
http://www.accessmvp.com/DJSteele/DSNLessLinks.html