SQL open error

D

Dave

I reinstalled SQL 2000 server after reformatting my drive.
Now I cannot open a database in my C## program as before.
If I use "Provider=SQLOLEDB;Data Source=localhost; Initial
Catalog=master;Integrated Security=SSPI"; I
get an Invalid login error. If I use "Provider=SQLOLEDB;
Data Source=localhost; Initial Catalog=master;User
ID=Dave;Password=midn1te"; I get the following error, "User
no associated with a trusted SQL server connection." What
did I do wrong on my installation? Anyone know what these
errors mean? I sure can't find the answers in the Help.
Dave
 
C

CT

Have you checked that the user account used for running your application can
still access the SQL Server database? It seems that SQL Server
authentication is disabled and only Windows authentication is enabled, which
makes sense from a security perspective. However, that means the second
connection string you present, won't work.
 
G

Guest

Carsten;
Thanks for your reply. I can access the SQL server
database thru the SQL Server Enterprise Manager. I don't
understand why the first connection string doesn't work in
my program. I tried to change the Server registration to
include SQL Server authentication in Enterprise Manager but
it keeps telling me that my user name is not associated
with a trusted SQL server connection, the same message I
get programmtically. How do I get my Windows ID to become
associated with a trusted SQL server connection?
Dave
 
C

CT

You must use the user ID and password you used when you reinstalled SQL
Server. What user account id the MSSQLServer Windows service running under?
If not LocalSystem, perhaps that might help you (provided you know the
password of course ;-)).
 
G

Guest

I wish to use Windows authentication rather than supplying
a password like I used to using Integrated Security=SSPI in
my connection string. What do I need to do to get it to
accept that string? I am the systemes administrator on my
box and have no need for passwords. The name of my server
in Enterprise Manager reads as (LOCAL) (Windows NT).
However, it refers to the server as XP when I do the
install which is the name of my computer. Is that
appropriate? If I use Integrated Security=SSPI and Data
Source=localhost in my connection string I get the error
"SQL server does not exist or access denied". If I use
Data Source=XP I get the error "Login failed for user
'XP\\ASPNET'. What options need I take when re-installing
the SQL server in order to use Integrated Security=SSPI in
my connection string?
Dave
 
C

CT

Ah, and ASP.NET application. You then need to implement impersonation or
allow the XP\ASPNET user account to access your database. The XP\ASPNET is
used by the ASP.NET worker process, which in turn means for running your
ASP.NET application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top