0

我有一个网站在今天早上之前运行良好。现在我得到一个

'对象'',数据库'',模式'dbo'的SELECT权限被拒绝。

错误。问题是,该方法是一些 DBML 代码的一部分,我什至找不到连接字符串。

    [global::System.Data.Linq.Mapping.FunctionAttribute(Name="RAW.GetCustomers")]
    public ISingleResult<GetCustomersResult> GetCustomers()
    {
        IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
        return ((ISingleResult<GetCustomersResult>)(result.ReturnValue));
    }

这是导致错误的生成的函数调用。我不得不假设数据库中有一些权限更改,或者登录不再有效,但是我在这段代码中找不到任何连接信息。web.config 中也没有任何内容。我在哪里可以找到所有这些的连接信息?我所拥有的只是一个包含被调用函数列表的图表。它是导致错误的 GetCustomers() 函数(见上文)。

这是web.Config。它显示了 RawParts 连接字符串,但不是导致问题的数据库连接字符串(动态是它的名称)

    <?xml version="1.0" encoding="UTF-8"?>

<configuration>
  <connectionStrings>
    <add name="MiscReportTablesConnectionString" connectionString="Data Source=pmfcgrb12;Initial Catalog=MiscReportTables;Persist Security Info=True;User ID=USERNAME;Password=PASSWORD"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />

    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

    <customErrors mode="Off"/>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true" />
        <defaultDocument>
            <files>
                <clear/>
                <add value="default.aspx"/>
            </files>
        </defaultDocument>
  </system.webServer>
</configuration>
4

1 回答 1

0

看起来您正在为您的函数使用 RAW 模式。确保您的登录用户有权访问模式,并检查函数的内容以查看它是否正在使用 dbo 模式下的任何对象,而用户将无权使用这些对象。

尝试以用户身份在 Management Studio 中以用户身份运行该函数,以隔离用户权限问题与连接字符串应用程序问题。

于 2018-10-22T00:50:19.660 回答