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

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

Related

Remote connection to SQL in MS access gets calculating state

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?

Enabling Auditing on Azure SQL Server (V12) breaks ADO.NET connection

In an attempt to do some basic profiling on our Azure SQL Server (V12) we enabled Auditing using the Azure portal.
Not many seconds later I had an angry developer on my hands that could not connect to the database using his client (HTML5 page).
I really couldn't see the connection, but since enabling auditing was the only change, I tried disabling Auditing again, and sure enough now the client could connect.
Further info:
I could access the SQL server using SSMS just fine.
The problem was only on the TEST environment from the customers network, not from our DEV environments (which is from Visual Studio on the developers own laptops).
Can anyone tell me why enabling auditing can break this? We tried doing it on other databases too, and sure enough: when I enabled auditing, the connection could not be established...
According to this page, if you want auditing on, the FQDN connection strings need to be changed:
Original server FQDN in the connection string: (server name).database.windows.net
Modified server FQDN in the connection string: (server name).database.secure.windows.net

SQL server cannot be connected

I am developing an Asp.net MVC4 application wherein i am using SimpleMemberShip provider for authorization and i am using database MSSQL Server 2012 on the same machine.
When i openup the SQL server management studio and connect to the database by using windows authentication and sql server authentication, in both ways it is getting connected.
But when i am specifying the connection string in the application with correct credentials,
Still the application is unable to connect to the database.
I have restarted the system but it did not resolve the issue.
I have opened the configuration tool of SQl server and enabled TCP\IP and namepipe client protocols for sql client as well as for the server and restarted all the sql server related services.
But still issue is remaining, i am sure about connection string it is 100% correct.
I am scratching my head from past 5 hrs but could not track down the issue.
Please tell me the possible solutions.
I would check firewall. If you have firewall (either default windows or using some AV) then temporarily disable it and see if it works.

Repeated Name/Password Requests Using MS Access 2003 and SQL Server 2008

We recently moved a database from MS SQL Server 2000 to MS SQL Server 2008. Everything works as expected with our main .NET client application but we are having problems with a MS Access 2003 application which connects via ODBC. A System DSN is used to make the connection.
When the database was running on SQL Server 2000 the Access application would request a user name and password once when the program was first started. Now, with the database running on SQL Server 2008 a user name and password dialog is requested every time a different table is accessed I believe.
This behavior occurs when using either the user account we have used for years and it also occurs if I use the database system admin account ( I know this is bad practice, it was just a test. )
What do I need to reconfigure to return to the previous, desirable behavior where the user is only authenticated a single time?
You could look at using a "DSN-Less" connection to MS SQL, microsoft provide instructions here: http://support.microsoft.com/kb/892490
The relevant connection string can be found here: http://www.connectionstrings.com/sql-server-2008#p3
All this aside, JMK's question is important, the method above is for if you are having linked tables to the server present in your Access database, however when working with dedicated database server's I always advise using "ADO" connections rather than "DAO" as this will avail better performance (especially if you are running queries)
If it is just queries you need to run then consider either the ADO method or take a look at the "Pass through" queries option, this like ADO will have the server doing the work rather than the local machine and the performance will be greatly improved.

IP Access to SQL Server

We have a Windows VPS server using SQL Server 2005 for our e-commerce site.
A while back we were suffering from attempts to access the database remotely so someone made changes so that only the IP of the server itself could access data. That was about 18 months ago and everything has been fine since.
However, we now have a second site (hosted on another VPS) that needs to access the same database and I can't get in contact with the person who made the original changes.
I know he was working in the SQL Server Management tool when he made the changes, can anyone point me in the correct direction.
Thanks.
SQL Server 2005 came locked down by default. Rather than SSMS, it also installs the SQL Server 2005 Surface Area Configuration tool, which has a Remote Connections setting where you can limit it to Local connections only.
You may also like to check any firewall on the server, which will have to allow Port 1433 (or different if changed from the default) TCP access from whichever machines you want to access it.
He might have turned the TCP/IP protocol off. In this case only the localhost can access the database. This link describes the procedure for sql server express, but the idea is the same

Resources