Click to See Complete Forum and Search --> : Problems connection to sql Server 2000 database


ed7890
June 23rd, 2005, 11:15 AM
Hey, i'm having a real problem getting my asp pages to connect to my sql database. I am using Microsoft SQL Server 2000. My database server is on my computer, and my .asp pages are on a server on my network at work.

The connection is line is:
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=EMF3JDALTON;Integrated Security=SSPI;DATABASE=here"

But my pages just comeback with the following error:
Microsoft OLE DB Provider for SQL Server error '80040e4d'

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

I can't find a solution to this problem that relates to my situation. It's probably they're not on the same server. Eventually they will be put together on a proper server, but i need this to work to develope them in the mean time. Is there any way of changing my setting or of running the .asp pages off my pc.

Thanks

mmetzger
June 23rd, 2005, 12:28 PM
Easy fix = Use SQL Authentication

Slightly More Difficult fix = Run IIS as a user with access to said database

I forget whether you can make standard asp scripts use impersonation. It's definitely possible to do so with ASP.NET so you don't have to provide all of IIS access.

ed7890
June 24th, 2005, 03:37 AM
How do i switch to SQL Authentication?

What do you mean run IIS

hspc
June 24th, 2005, 03:55 AM
How do i switch to SQL Authentication? connect to SQL Server using username and password made by the admin...
Include the username and password as :(from http://www.connectionstrings.com/)"Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
this requires SQL Server to have mixed mode authentication (windows and sql server authentication)

ed7890
June 24th, 2005, 05:25 AM
I tried to add a password to my database but when i do SQL Server 2000 says i can't log on cause i dont come from a trust sql source or someshit. and this makes no difference to the error i get on my webpage

hspc
June 24th, 2005, 08:00 AM
I tried to add a password to my database but when i do SQL Server 2000 says i can't log on cause i dont come from a trust sql source or someshit. and this makes no difference to the error i get on my webpage
Checklist :
remove the Integrated Security=SSPI part
add username (User ID) and password
Set the default database for the user (from enterprise manager)
make sure that mixed mode is enabled.

Vanaj
June 28th, 2005, 01:57 PM
this requires SQL Server to have mixed mode authentication (windows and sql server authentication) Here is how you do this.

1. Open SQL Server Enterprise Manager
2. Select "Tools" from the top menu.
3. Select "SQL Server Configuration Properties"
4. Select the "Security" TAB.
5. Under "Authnentication" select the radio button
"SQL Server and Windows"

This will now allow you to connect using the userID/Password for the database of by Windows SSPI security.

HTH...