How to connect SQL Server with ASP Page

Results 1 to 2 of 2

Thread: How to connect SQL Server with ASP Page

  1. #1
    Join Date
    Dec 1969

    Default How to connect SQL Server with ASP Page

    How to connect SQL Server with ASP Page<BR>----------------------------------------<BR><BR>At the time of running ASP page I am getting undermention error msg:-<BR><BR>__________________________________________ _______________________<BR>Error Type:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)<BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user &#039;IOPIUSR_IOP&#039;.<BR>/sql/sqlpubs.asp, line 4<BR>_____________________________________________ ____________________<BR><BR>I have used undermentioned code for running the ASP page :-<BR><BR>&#060;%<BR>dim objconn<BR>set objconn = server.createobject("adodb.connection")<BR>objconn .open "DSN=test" <BR>dim objrs <BR>set objrs=server.createobject("adodb.recordset")<BR>ob "table", objconn <BR>response.write objrs("name")<BR>objrs.close<BR>set objrs=nothing<BR>objconn.close<BR>set objconn=nothing<BR>%&#062; <BR><BR>__________________________________________ _______________________<BR><BR>I have created the DSN connection as under :-<BR><BR>In System DSN I have selected SQL Server and in name option I have entered - &#039;test&#039; and<BR>in Server I have entered- &#039;(local)&#039;.<BR><BR>Further, in SQl Server I have created a new database with the name- &#039;test&#039; and with <BR>table name-&#039;table&#039; and with field name- &#039;name&#039;.<BR><BR>I would be highly obliged to have the reply.<BR><BR>With best regards,<BR><BR>R.John<BR>

  2. #2
    Join Date
    Dec 1969

    Default The database is protected.

    The error says that it can&#039;t login using the user &#039;IOPIUSR_IOP&#039;, which is the username that the web server uses to connect to your database. This indicates that your database is set up with the wrong access rights. I don&#039;t know how to change it in SQL server, but I hope this still helps.<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts