Ask Experts Questions for FREE Help !
Ask
    Grammarian-Bot's Avatar
    Grammarian-Bot Posts: 78, Reputation: 2
    Junior Member
     
    #1

    Jul 7, 2006, 12:08 PM
    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.
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #2

    Jul 10, 2006, 12:50 AM
    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
    yesh kumar's Avatar
    yesh kumar Posts: 3, Reputation: 1
    New Member
     
    #3

    Aug 7, 2008, 11:56 PM
    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.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Can't connect [ 1 Answers ]

I can't seem to connect directly to my cable modem. I setup a wireless network and it was working fine but then I started having problems. I then decided to reset and reconfigure my router but when I tried to connect directly to my modem, it either didn't show the connection or it said that I have...

Can't connect [ 4 Answers ]

I am having a problem getting my Browser to connect to the internet. I am using my wife's computer right now. I don't know what could have happened as earlier I was surfing the net (I was even logged in to this site) when all of a sudden everything went blank. I have tried connecting with IE,...

Can't connect [ 5 Answers ]

I can't seem to connect directly to my cable modem. I setup a wireless network and it was working fine but then I started having problems. I then decided to reset and reconfigure my router but when I tried to connect directly to my modem, it either didn't show the connection or it said that I have...

Can't connect [ 2 Answers ]

I can't seem to connect directly to my cable modem. I setup a wireless network and it was working fine but then I started having problems. I then decided to reset and reconfigure my router but when I tried to connect directly to my modem, it either didn't show the connection or it said that I have...


View more questions Search