SQL Server Stored Procedure Authentication

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default SQL Server Stored Procedure Authentication

    Hello,

    I am tyring to add a level of security to my application with using a username
    and password to authenticate to the database with when using CFStoredProc to
    call a SQL Server 2005 Express Stored Procedure. Right now the calls to the
    stored procedures work fine if I don't include the database connection
    information. They will also work if I use the "SA" connection information for
    all instances of the SQL Server 2005 Express Server. I cannot get the stored
    procedure calls to work when I use just the database owner of the individual
    instance/database of this application though. I think this would be the ideal
    way to do it security-wise because I am setting this connection information in
    my application.cfm file and if that file were to ever be compromised, then they
    would only be able to access the instance/database of this application instead
    of all the instances contained on the whole SQL Server 2005 Express Server.
    Make sense?? Below is the code in my application.cfm and a stored procedure
    call if that helps as well.

    <!--- setting stored procedure connection info in application.cfm --->
    <CFSET application.username = "user1">
    <CFSET application.password = "password">

    <!--- STORED PROCEDURE CALL --->
    <cfstoredproc datasource="#application.dsn#" username="#application.username#"
    password="#application.password#" procedure="sp_GetLocations">
    <cfprocresult name="GetLocations">
    </cfstoredproc>

    The error I get is "Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user 'user1'"

    I am pretty sure that the user is setup correctly on the SQL Server side as
    well. I used the sp_grantdbaccess stored procedure and the user showed up in
    the list of users for the database. Is there something else that I need to do
    on the SQL Server side? Perhpas make that user the dbowner or something??

    Thanks in advance,
    airnewhouse


    airnewhouse Guest

  2. Similar Questions and Discussions

    1. RecordCount with Stored Procedure in SQL Server
      Hi everyone, I have noticed that if I used a stored procedure to populate an ADO RecordSet it only returns a .RecordCount property if that stored...
    2. Legacy ASP, SQL Server, Paging Stored Procedure - resend
      I'm not sure if this made it so I'm resending it (with correction): This is the best I could come up with. The only other solutions I could think...
    3. Inserting Full Stops into SQL Server 2000 using ASP and stored procedure
      Hi All, I am attempting to use a standard HTML form to pass a parameter to an ASP stored procedure, which searches a database for customer...
    4. Deploying a Db2 PL stored procedure on the production server
      We are setting up a DB2 (UDB 8.1) environment. I need some guidance to set up the development and deployment process. Lets say I have a...
    5. Stored procedure help, makes server jump to 100%
      Hello, we have a users table with the following fields: client_id varchar 20 counter1 int counter2 int .. .. .. counter50 int
  3. #2

    Default Re: SQL Server Stored Procedure Authentication

    OK, I gave the user the db_owner role, but that didn't seem to help either....
    airnewhouse Guest

  4. #3

    Default Re: SQL Server Stored Procedure Authentication

    Can you log into Query Analyzer as user1 and run the SP? Does the user have explicit permissions to the SP? You may have to give explicit permissions for it to work.
    philh Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139