Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can't Connection to SQL Server 2005 Express via Classic ASP

Posted on 2008-06-16
3
Medium Priority
?
561 Views
Last Modified: 2008-06-24
I setup a SQL Server 2005 database on my local machine and I'm trying to access it via classic ASP.  I setup a DSN and tested the connection and it works.  However, whenever I try to use it, I get a "login failed" message.  Also, if I try to connect without DSN I get a similar message.  Below are the exact strings I've tried an the corresponding messages.  Please help!

'Connection String via DSN
Conn.Open "DSN=MHH"

'Error Message
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "myherbalharmony" requested by the login. The login failed.

'Connection String non-DSN
Conn.Open "Provider=SQLNCLI;Data Source=USERE3A8\SQLEXPRESS;Initial Catalog=myherbalharmony; Integrated Security=SSPI"

'Error Message
Microsoft SQL Native Client (0x80004005)
Cannot open database "myherbalharmony" requested by the login. The login failed.
0
Comment
Question by:Shiseiryu1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Dxpert
ID: 21796278
I think the problem here, has to do with the permissions. How's the permissions set on sql?
What I'm trying to say here is that, when you (the logged in user) runs the DSN test connection it work, because you have access to the DB. But when you try it through ASP it will fail because it runs under the IUSR_machine identity.
0
 

Author Comment

by:Shiseiryu1
ID: 21797028
I totally agree.  My iuser account is IUSR_usere3a8; however, I can't find where to adjust the permissions for it in SQL.  If I open up the SQL Server Management Studio Express > right click the database > select "Properties" > select "Permissions" > Select "Add" > and type "IUSR_usere3a8" it doesn't find the name.  

What am I missing here?

Thanks in advance.
0
 
LVL 10

Accepted Solution

by:
Dxpert earned 1500 total points
ID: 21797166
I can't really test it here, but maybe you should try to create a login account for sql, and use that instead of the integrated security. Try the approach this guys has here: http://www.sitepoint.com/forums/showthread.php?t=358567

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question