Errors connection to SQL Server Express

C

Chris Burnette

I have a bound form in Access that users will use to access the data in a SQL
Server Express database via a linked table. However, when I try to open the
form I get the message:

Login failed for user (null); not associated with a trusted SQL Server
connection.

The SQL Server Login box then appears. I enter the server name and my SA
username and password, which I use to log in to the server. I then get the
message:

Connection failed:
SQLState: '08004'
SQL Server Error: 4060
Server rejected the connection; Access to selected database has been denied.

I don't understand this message. I never had trouble connecting to the DB
with my SA login in MSDE, but for some reason I am having problems with
Express. I started the Browser service and enabled TCP/IP, so that shouldn't
be a problem, and I'm trying to connect to an instance on my local machine
anyway. I can connect to SQL Server Express Management Studio with my SA
login, so I am thinking the problem must be with connecting via Access.

I use a login form that passes the user's username and password to SQL
Server via a connection string, and I can login without error using this
form (I had to change the port in the connection string from 1433 as I think
that was conflicting with MSDE).

Does anyone have any ideas why I might be having this problem with Express?
Any suggestions would be appreciated.

Thanks,

Chris
 
S

Sylvain Lafontaine

Try stopping the MSDE service and connect to SQL-Express using the regular
port 1433 to see if the problem is coming from that.

If you specify the port number, the Browser service won't be used, so you
must make sure that the default port has been correctly changed for
SQL-Server. Instead of trying to set the port number, you should add the
name of the instance after the name of the server in the connection string:
localhost\SQLExpress.

If TCP/IP won't work, then try using a named pipe: (local)\SQLEXPRESS

I don't have SQL-Server Express 2005, so I cannot tell you if the name of
the instance if really SQLEXPRESS; you should use whatever you really have
instead.
 
C

Chris Burnette

Thanks for the reply. It turns out my connection string was correct but I
just had my tabledef linked to the wrong server. I fixed the tabledef and it
works now.

Thanks,

Chris
 

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