Sunday, March 25, 2012
Authentication Problems
on laptops. This then replicates with a central server. The laptops, server
etc are all on the same domain and the database uses Windows Authentication
only.
Everything works fine when running W2K.
However following the installation of SQL Server 7 and the app on laptops
running XP SP2 we are experiencing problems. The app runs fine when the user
is VPNed into the network but when they are working remotely with only their
local databases problems occur.
Usually the app authenticates seamlessly with the local database but under
XP SP2 a dialog entitled 'SQL Server Login' is displayed and access to the
database is not allowed.
There are also issues in relation to the running of the SQL Server Agent.
When working remotely users cannot start the service properly, they receive
the following message :
'The sqlserveragent service on local computer started and then stopped.
Some services stop automatically if they have nothing to do , for example,
the performance logs and alerts service'.
My suspicion is that it is an XP SP2 issue.
There may be issues related to the installation of IIS as well but I'm not
sure.
Any help to solve this problem would be gratefully appreciated.
Thanks,
DD.Yeah, XPSP2 is your culprit there.
Make sure you've followed these articles:
How to configure Windows XP Service Pack 2 (SP2) for use with SQL Server
Contains links to articles that you can use to help you configure Windows
Firewall to permit access for SQL Server, Analysis Services, and MSDE.
http://support.microsoft.com/default.aspx?scid=kb;en-us;841249
Microsoft SQL Server: FAQ: How Windows XP Service Pack 2 (SP2) Affects SQL
Server and MSDE
Get answers to frequently asked questions about how Windows XP Service Pack
2 (SP2) affects installations of SQL Server 2000 and MSDE
http://www.microsoft.com/sql/techinfo/administration/2000/security/winxpsp2faq.asp
Donna Lambert
"Dave52" wrote:
> We have an application which uses a SQL Server 7 database installed locally
> on laptops. This then replicates with a central server. The laptops, server
> etc are all on the same domain and the database uses Windows Authentication
> only.
> Everything works fine when running W2K.
> However following the installation of SQL Server 7 and the app on laptops
> running XP SP2 we are experiencing problems. The app runs fine when the user
> is VPNed into the network but when they are working remotely with only their
> local databases problems occur.
> Usually the app authenticates seamlessly with the local database but under
> XP SP2 a dialog entitled 'SQL Server Login' is displayed and access to the
> database is not allowed.
> There are also issues in relation to the running of the SQL Server Agent.
> When working remotely users cannot start the service properly, they receive
> the following message :
> 'The sqlserveragent service on local computer started and then stopped.
> Some services stop automatically if they have nothing to do , for example,
> the performance logs and alerts service'.
> My suspicion is that it is an XP SP2 issue.
> There may be issues related to the installation of IIS as well but I'm not
> sure.
> Any help to solve this problem would be gratefully appreciated.
> Thanks,
> DD.
Sunday, February 12, 2012
AttachDBFileName option in Connection String
dim source as string="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Registration.mdf;User Instance=true"
However, when I uploaded the application to a web server where my site is hosted, I spent considerable time debugging the "Cannnot establish connection" exception, I was getting.
After adding "Database=Registration.mdf;server=<server N/W address>" and removing
"AttachDBFilename=|DataDirectory|Registration.mdf;" from the connection string, the connection was finally established.
Now, I have two questions: What's the difference between database and attachDBFileName options (And when should I use which)?
Secondly, why I had to add the server option, when it worked fine locally, and the application & db are located on the same web server?
You might look following link. you need to provide the database name along with the DB filename
http://msdn2.microsoft.com/en-us/library/ms130822.aspx
|||Are database name & DB Filename not the same? Do you mean complete DB Path when you say DB FileName?Moreover, what is an attachable Database? The primary file of an attachable database is the default primary data file or it can be any primary data file?
Also the ODBC driver Connection String mentions following:
"The database must be an existing database unless AttachDBFileName is also specified. If AttachDBFileName is also specified, the primary file it points to is attached and given the database name specified by Database"
Does that mean that if Database attribute contains a non-existent DB name, but AttachDBFileName contains a valid primary filename, then a database is created by that name?
|||
Here.. what u need to understand is ... u r using the unique Embedded Database feature of SQL Server Express. U r dynamically attaching the database.
Refer this link it will help u
Connecting to SQL Express User Instances in Management Studio
http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx
AttachDBFilename is unique to SQL Express, it spins up a user instance of SQL Express attached to a specific DB Filename for single user mode. Database is simply the name of the database to use, it has no additional connotation. For any production server, you would most likely not be using AttachDBFilename. It is strictly useful for development and experimentation in single-user mode.
You had to change data source=.\SQLEXPRESS on the production server because it did not have a named instance of SQL Express running on it. The syntax of a server name is <Server>\<instance>. Note that a blank <instance> is equated to the default instance. In your case, the web server is running a default instance of SQL Server. The option to install a default instance is available in SQLEXPRESS as well, though you have to select it explicitly or else it installs as a named instance with the name SQLEXPRESS. You could have used (local) or localhost or . or <COMPUTERNAME> instead of the IP on the server, so long as you don't specify an absent instance name.
Hope that cleared things up for you,
John
AttachDBFileName option in Connection String
dim source as string="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Registration.mdf;User Instance=true"
However, when I uploaded the application to a web server where my site is hosted, I spent considerable time debugging the "Cannnot establish connection" exception, I was getting.
After adding "Database=Registration.mdf;server=<server N/W address>" and removing
"AttachDBFilename=|DataDirectory|Registration.mdf;" from the connection string, the connection was finally established.
Now, I have two questions: What's the difference between database and attachDBFileName options (And when should I use which)?
Secondly, why I had to add the server option, when it worked fine locally, and the application & db are located on the same web server?
You might look following link. you need to provide the database name along with the DB filename
http://msdn2.microsoft.com/en-us/library/ms130822.aspx
|||Are database name & DB Filename not the same? Do you mean complete DB Path when you say DB FileName?Moreover, what is an attachable Database? The primary file of an attachable database is the default primary data file or it can be any primary data file?
Also the ODBC driver Connection String mentions following:
"The database must be an existing database unless AttachDBFileName is also specified. If AttachDBFileName is also specified, the primary file it points to is attached and given the database name specified by Database"
Does that mean that if Database attribute contains a non-existent DB name, but AttachDBFileName contains a valid primary filename, then a database is created by that name?
|||
Here.. what u need to understand is ... u r using the unique Embedded Database feature of SQL Server Express. U r dynamically attaching the database.
Refer this link it will help u
Connecting to SQL Express User Instances in Management Studio
http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx
AttachDBFilename is unique to SQL Express, it spins up a user instance of SQL Express attached to a specific DB Filename for single user mode. Database is simply the name of the database to use, it has no additional connotation. For any production server, you would most likely not be using AttachDBFilename. It is strictly useful for development and experimentation in single-user mode.
You had to change data source=.\SQLEXPRESS on the production server because it did not have a named instance of SQL Express running on it. The syntax of a server name is <Server>\<instance>. Note that a blank <instance> is equated to the default instance. In your case, the web server is running a default instance of SQL Server. The option to install a default instance is available in SQLEXPRESS as well, though you have to select it explicitly or else it installs as a named instance with the name SQLEXPRESS. You could have used (local) or localhost or . or <COMPUTERNAME> instead of the IP on the server, so long as you don't specify an absent instance name.
Hope that cleared things up for you,
John