Login failed for user

Posted by Chitrasathiya under Others on 3/16/2010 | Views : 1392 | Status : [Member] | Replies : 3
I am using ASP(not asp.net) application. While running through IIS,not able to connect the database.I am using sql server 2005 as backend and using windows authentication mode.

Can anyone tell me how to do this.




Responses

Posted by: Raja on: 3/16/2010 [Member] Starter

Up
0
Down
I would suggest to go through this website and ensure that you are giving correct connectionstring to the database.

http://connectionstrings.com/

Also, you will need to create proper credentials in your database.



Regards,
Raja, USA

Chitrasathiya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gttejas on: 3/18/2010 [Member] Starter

Up
0
Down
While using windows authentication use integratedsecurity=true in connection string.

also if you are running it through iis, you need to give rights to database for your aspnet user becasue iis will access
database throgh this account.


Please mark this as answer if it solve your problem.

Chitrasathiya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 3/26/2010 [Member] Bronze

Up
0
Down
. This is classic ASP and JavaScript.

In the global.inc.asp page:

<%

// Constants
var connString = "Driver={SQL Native Cleint}; Server=serverName\instanceName; Database=databaseName; User ID=userName; Password=password;";

// and more code follows

Then in the layout1.inc.asp page:

<%
var conn = Server.CreateObject("ADODB.Connection");
conn.Open(connString);

var RS = Server.CreateObject("ADODB.recordset");

// and more code follows

Then in the index.asp page:

<% @language="JScript" %>

<%
var title = "gallatin county emergency management";
%>

<!-- #include file="global.inc.asp" -->
<!-- #include file="layout1.inc.asp" -->

// and more code follows

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Chitrasathiya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response