Remote connection to SQL in MS access gets calculating state - sql-server

I have 2 machines which locate in same network. In first is running SQL Server 2014 Express and in second is running a MS Access application which uses the database.
But the problem is if I start MS Access, the first form loads successfully but application is very slow. I have a lot linked tables is MS Access which use database. At the bottom of window has state "Calculating..".
Currently i have allowed remote connection to SQL. I have disabled firewall on the SQL Server machine. I have tested connection via telnet from machine 2 to the SQL Server machine and it was successful.
So what am I missing that my connection via MS Access fails? Can there be some user permissions (but telnet connection was successful)? Is it possible to debug MS Access somehow why the connection is slow?

Related

Cannot connect Access to SQL Server Linked Tables - error message loggingin

I have a client for which I am setting up a new SQL Server Express and (on a different computer) connecting their Access front end to that SQL Server. I created an account on SQL Server, changed authentication to SQL Server. I am able to log on to that account with no issues locally (through SQL Server Management Studio) on the server itself, but when I go back to the client machine and try to create either an ODBC connection or connect directly in Linked Table manager, I get the error below. Looking at the error log in SQL Server I can see no failed logins. In Access and/or ODBC I use Servername\SQLEXPRESS, choose SQL authentication and type in the username/password that I created. But it's still being stubborn.
I'm kind of at my wits end with this one. I checked to make sure that login is enabled, that the created database is mapped to this user, but I'm out of answers. Anyone have any ideas? I'm sure it's something really stupid that I'm overlooking, I've used SQL Server for a long time but I'm not an experienced DB Administrator I'm sure it's something really simple I'm overlooking, but I've done this hundreds of times before. And Windows Authentication won't work because it's on a different computer.
To connect to a named instance on SQL Server Express with Servername\SQLEXPRESS, you need:
SQL Server Browser service running,
and its UDP port 1434 open in the firewall.
https://learn.microsoft.com/en-us/sql/sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access
SQL Server Browser service
UDP port 1434
The SQL Server Browser service listens for incoming connections to a named instance and provides the client the TCP port number that corresponds to that named instance.
The fixed TCP port for your instance open in the firewall.
You set this in SQL Server Configuration Manager
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port
This looks more like a network setting rather than server issue.
Check if all necessary permissions, configuration and settings on your machine running the server are OK to accept external connections.
Usually its the server that is rejecting the connection for security reasons.

SQL Server 2017 Remote access

I have tried every conceivable permutation for hours to try to connect to a remote SQL Server 2017 using SSMS. I keep getting:
Logging failed for user xxx. (Microsoft SQL Server Error 18456)
I know SQL Server is running on the remote machines since I can log
in locally there using SSMS.
SQL Browser is running.
TCP/IP is enabled. There are no dynamic
ports in IP All.
I know the firewall is not a problem since I can
telnet to port 1433 from the remote machine, and I added the rule to allow access.
I have "Enable Remote Access" turned on in SQL Server.
I have both Windows and SQL Server Authentication enabled.
I have user mappings for the given databases.
I can connect locally using SSMS with the Sql Server Auth user/passwd that I am trying to use remotely.
When logging in from the remote client in SSMS:
I use an IP address for the server (although I can also browse to the server as I have UDP 1434 open).
I use SQL Server Authentication.
I looked at Event Viewer on the SQL Server machinee to see if it gives me more clues as to why the log in is failing, but it is worthless.
I saw this, but it is of no help.
What on earth could be left that is the problem?

Invalid Key for attachdbfilename

I am using SQL Server DB. The connection string is
Data Source=office1\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dbSQLTest.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True
On local computer it is fine. On the network computer, it gives
"Invalid Key for attachdbfilename"
I do not want to make server client application. My purpose to use Sql server DB is to run my application on 3-4 computer simultaneously. I just make shortcut from my main computer to the network computers.
The reason why I donot attach with server instance is that it is difficult for the users to attach DBs with server and then manage SSMS.
Please advise
Thanks
Furqan
AttachDbFilename is used with local database. If you have remote database then the connection string will be different. Have a look at article - How to configure SQL Server 2005 to allow remote connections.
I'm not sure I am understanding you correctly, but you can't simultaneously attach the same MDF on a network drive by several concurrent users (like you can do with MS Access).
Rather just install SQL Express on a central computer and open it up for remote TCIP/IP access, and change the connection string to an IP / instance one.

In Excel 2007, link to a SQL Server DB with the data connection not possible

I have data in a SQL Server 2008 db and I want to get the reporting in Excel.
I have created view for that and I want to link them to Excel using the Data / Connection tool available in Excel 2007.
When I do the import in Excel from the SQL Server on the server machine (ie, where the SQL Server is running) everything is fine and I can refresh manually or automatically (which is what I'm looking for).
But when I try to refresh (or do the link) from an other machine it does not work: I have the following message " [DNETLIB][ConnectionOpen (Connect()).]SQLServer does not exist or access denied "
The TCP IP protocol is available on the server and a telnet on the port 1433 is working.
So I don't know what could be the problem. Any idea?
You could try adding: namedPipe=true to the connection string.
Can you connect via any other method from the client machine i.e. using SQL Server Tools? Establish whether it is Excel or general connectivity issue first.

MS Access 2003 + linked tables to SQL Server 2005 + Windows Authentication = slow

Our MS Access application with linked tables to SQL Server 2005 is slow when using Windows Authentication from Windows XP clients.
We've been running it successfully using SQL Server authentication, but now we want to move to Windows Authentication for better security control.
Setup:
Database server: Windows 2003 Server, SQL Server 2005 SP2
Client: Windows XP SP3, SQL Server ODBC driver v2000.85.1132.00
MS Access application: MS Access 2003
Connection string:
DRIVER=SQL Server;SERVER=[server name];Connect Timeout=300;Trusted Connection=True;APP=Microsoft Office 2003;WSID=[server name];DATABASE=[db name]
Only the TCP/IP network protocol is enabled on the server.
The slowness does not happen in these situations:
App on DB server, SQL Server Authentication
App on DB server, Windows Authentication
App on Windows XP client, SQL Server Authentication
SQL Server Management Studio on client, Windows Authentication - I did a small test with running 15 queries in SQL MS. This went fast and did not cause any logon/logoff events in the Security event log on the server.
I've analyzed the slowness using SQL Server Profiler and the event log on the server and it seems to come down to this:
The application runs a query
A new connection to SQL Server is opened (visible in SQL Server Profiler)
The identity of the user is verified (visible in the Security event log on the server, a logon/logoff event happens). This takes several hundreds of milliseconds.
The query runs on SQL Server
Results are returned to Access
This happens for every query. Some of the forms run +- 10 queries when showing a new record (updating sub forms, loading values for combo's etc). This results in very slow performance.
Of course setting up a new connection to SQL Server for every query isn't necessary, and reusing connections might solve the issue. I've been looking around for information on how to make sure Access/ODBC does proper connection pooling. I found these MS KB articles:
Frequently Asked Questions About ODBC Connection Pooling
How to Enable Connection Pooling in an ODBC Application
I've tried calling the SQLSetEnvAttr function from the main form of the Access application, but this didn't improve results.
Any help is greatly appreciated.
The first question I have is: are you running a domain controller? This may sound like a crazy question, but I just want to make sure. Although is less and less common, I've seen organizations run Windows networks with workgroups and "pass-through" authentication. The symptoms you describe are the same as would be observed on a network that is set up in this fashion.
Assuming you do have a proper domain set up, you must have a problem somewhere in the Named Pipes network stack. Named Pipes is the default protocol if you're using Windows authentication. It's not a bad idea to get to the bottom of this if you have the time, but if you just want to fix your performance problem, then I would force the TCP/IP protocol in your connection string:
DRIVER=SQL Server;SERVER=tcp:[server name];Connect Timeout=300;Trusted Connection=True;APP=Microsoft Office 2003;WSID=[server name];DATABASE=[db name]
Note the addition of the tcp: prefix. I got this syntax from Jon Galloway's blog. TCP/IP is the default protocol for SQL Server Authentication. You can also make the protocol switch by disabling Named Pipes support on the server, but this is more of a hassle and could cause other unanticipated problems.
Check Microsoft SQL Server Native Client
at http://www.microsoft.com/downloads/details.aspx?FamilyID=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

Resources