SQL stored procedures to work on a asp page.

Posted on 2011-04-29
Last Modified: 2012-05-11
I have a stored procedure on a SQLServer 2008. I want to run this procedure from a web page. When i try to run the stored procedure i get this error

but if i run the SQL query straight from the web page it works. I am currently using asp, but the code will be converted to JSP when i am done.

The stored procedure works fine on the SQL Server.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 

[Microsoft][ODBC SQL Server Driver][SQL Server]Could not connect to server 'HPFDATA' because 'bay_portal' is not defined as a remote login at the server.

Open in new window

Question by:jennifer_merritt
    LVL 8

    Expert Comment

    Search for How the stored procedure call from asp . you will get lot of examples
    LVL 4

    Expert Comment

    Looks to me like you are using a user that doesn't have rights.
    LVL 9

    Accepted Solution

    Execute this first against SQL Server, And then execute your ASP Code.

    sp_AddRemoteLogin 'HPFDATA','bay_portal';
    LVL 21

    Expert Comment

    by:Alpesh Patel
    Ohh, Please check the permission (remote login) to user.
    LVL 3

    Expert Comment

    by:Andy Green
    ASP.Net uses the Network Account but ASP uses the IUSER account. Check that there are permissions in SQL for the IUSER account, it will look something like IUSER_xxxxx where xxxx is the machine name.

    LVL 4

    Expert Comment

    Never add the IUSER account to SQL Server. The connection to SQL Server from your .ASP application will use the username in the connection string. Make that user has appropriate rights on the SQL Server.

    Author Comment

    I am still haveing issues with this, but i decided to move the code to a portlet in JSP. So wish me luck.

    thank you for all your replys!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now