Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Scripting > ASP   »   I can't connect my ASP page with MSSQL

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old Jul 7, 2006, 11:08 AM
Grammarian-Bot
Junior Member
Grammarian-Bot is offline
 
Join Date: Jan 2006
Posts: 85
Grammarian-Bot See this member's comment history on his/her Profile page.
I can't connect my ASP page with MSSQL

This is what my connect.asp looks like.
<Html>
<Head>
<Title> Testing Our Connection </Title>
</Head>
<Body>
<%
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
adOpenForwardOnly=0
adLockReadOnly=1
adCmdTable=2

Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.CONNECTION")
Set objRS = Server.CreateObject("ADODB.RECORDSET")

Dim strDatabaseType
strDatabaseType = "MSDE"

objConn.Open "Driver={SQL Server};" & _
"Server=127.0.0.1;" & _
"Database=payroll;" & _
"Uid=;" & _
"Pwd=;"


objRS.Open "payroll", objConn, adOpenForwardOnly,adLockReadOnly, adCmdTable

While not objrs.eof
rsponse.write objrs.fields("emp_id") & "<br>"
objrs.movenext
Wend

objrs.Close
Set objrs = Nothing

objconn.Close
Set objconn = Nothing
%>
</body>
</html>

But when i open it in my IE i get the following Error Message.


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'ADMINISTRATOR\IUSR_FAHAD'.
/begasp/connect.asp, line 22
line 22 is the connection string line on my editor.

Please can someone telll me how can i fix this problem.

Reply With Quote
 
     

Answers
 
 
Old Jul 9, 2006, 11:50 PM   #2  
LTheobald
Ultra Member
LTheobald is offline
 
LTheobald's Avatar
 
Join Date: Feb 2004
Location: Cambridge, UK
Posts: 1,047
LTheobald See this member's comment history on his/her Profile page.LTheobald See this member's comment history on his/her Profile page.
Call LTheobald via Skype™ Send a message via MSN to LTheobald
Has the username in the error message been given rights to access the database? That's what the error message is saying - the user doesn't have access to the db
  Reply With Quote
 
     
 
 
Old Aug 7, 2008, 10:56 PM   #3  
yesh kumar
New Member
yesh kumar is offline
 
Join Date: Aug 2008
Posts: 1
yesh kumar See this member's comment history on his/her Profile page.
you should pass the Userid and Password details in UID and PWD. Now it is taking the Windows authentication to connect to SQL where it is getting failed.
  Reply With Quote
 
     


Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
Can't connect how Internet & the Web 4 Jul 6, 2006 08:15 AM
Redirect to page 1 after commenting on post in page 2 valinors_sorrow Forum Help 11 May 27, 2006 12:22 PM
cant connect evilchrispark Networking 5 Feb 25, 2005 02:48 AM
cant connect evilchrispark Computers for Beginners 2 Nov 24, 2004 09:56 PM
cant connect evilchrispark Internet & the Web 0 Nov 18, 2004 12:09 AM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 08:56 PM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.