Shiseiryu1
asked on
Can't Connection to SQL Server 2005 Express via Classic ASP
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.
'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
'Error Message
Microsoft SQL Native Client (0x80004005)
Cannot open database "myherbalharmony" requested by the login. The login failed.
ASKER
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.
What am I missing here?
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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.