Home All Groups Group Topic Archive Search About

Error 2571 - not permission to run DBCC TRACEON

Author
19 Jan 2006 9:29 AM
Soren
Hi,

I am trying to connect to SQL Server 2005 via Excel/ODBC. (ODBC Test IS
successfull) and get the following error after entering Login ID and Password:

Connection failed:
SQLState: '37000'
SQL Server Error: 2571
......does not have permission to run DBCC TRACEON

Security setup on SQL Server seems to be fine (I can connect to SQL Server
from Reporting Services on same Login/Password).

Any idears?

Best regards,

Soren

Author
19 Jan 2006 10:26 AM
amish
To run DBCC Traceon you requires membership in the sysadmin fixed
server role.


Regards
Amish
Author
19 Jan 2006 12:59 PM
Soren
That did it! Thanks !!!

Show quote
"amish" wrote:

>
> To run DBCC Traceon you requires membership in the sysadmin fixed
> server role.
>
>
> Regards
> Amish
>
>
Author
31 Jan 2006 6:56 PM
preddy
I had the same problem, but there are multiple users who use that
spreadsheet using Windows authentication. I did not want any of them to
be sysadmins. They only had SLECT permissions to certain tables. In my
case, deleting the Application name (from the SQL Server Login dialog)
fixed it. You need to click the Options button on the dialog to see
this. The application name seems to be an issue if it has certain
characters (like ®  in Microsoft® Query). Depending on the MS Office
version, the default value may be Microsoft® Query/MS Office XP/??.

You can also programmatically change the connection string (and even
the command text if necessary). Here is a sample.

'ChangeConnection
Sub ChangeConnection()

    Dim sh As Worksheet
    Dim qt As QueryTable

    Dim sConnection As String

    For Each sh In ActiveWorkbook.Sheets
        For Each qt In sh.QueryTables

            'Show current connectionstring
            MsgBox ("Tab: " & sh.Name & vbCr & " Current Connection: "
& vbCr & qt.Connection)
            'Show current query
            MsgBox ("Tab: " & sh.Name & vbCr & "Current Query: " & vbCr
& qt.CommandText)

            'Change Connection
            qt.Connection = "ODBC;DRIVER=SQL
Server;SERVER=myserver;DATABASE=myDB;Trusted_Connection=Yes;APP=Excel_TopCustomers;"

            'Change Qry text (the owner for instance)
            qt.CommandText = Replace(qt.CommandText, "DB.dbo.",
"DB.Me")

            qt.SavePassword = False

            'Show new connectionstring
            MsgBox ("Tab: " & sh.Name & vbCr & "Connection: " & vbCr &
qt.Connection)
            'Show new query
            MsgBox ("Tab: " & sh.Name & vbCr & "Query: " & vbCr &
qt.CommandText)

        Next qt
    Next sh

End Sub
Author
1 Feb 2006 10:16 AM
Ade
I have the exact same problem using Excel 97/MS-Query8.  I tried your
suggestion, it did not work.  I am still getting the error.
--
Ade


Show quote
"preddy" wrote:

> I had the same problem, but there are multiple users who use that
> spreadsheet using Windows authentication. I did not want any of them to
> be sysadmins. They only had SLECT permissions to certain tables. In my
> case, deleting the Application name (from the SQL Server Login dialog)
> fixed it. You need to click the Options button on the dialog to see
> this. The application name seems to be an issue if it has certain
> characters (like ®  in Microsoft® Query). Depending on the MS Office
> version, the default value may be Microsoft® Query/MS Office XP/??.
>
> You can also programmatically change the connection string (and even
> the command text if necessary). Here is a sample.
>
> 'ChangeConnection
> Sub ChangeConnection()
>
>     Dim sh As Worksheet
>     Dim qt As QueryTable
>
>     Dim sConnection As String
>
>     For Each sh In ActiveWorkbook.Sheets
>         For Each qt In sh.QueryTables
>
>             'Show current connectionstring
>             MsgBox ("Tab: " & sh.Name & vbCr & " Current Connection: "
> & vbCr & qt.Connection)
>             'Show current query
>             MsgBox ("Tab: " & sh.Name & vbCr & "Current Query: " & vbCr
> & qt.CommandText)
>
>             'Change Connection
>             qt.Connection = "ODBC;DRIVER=SQL
> Server;SERVER=myserver;DATABASE=myDB;Trusted_Connection=Yes;APP=Excel_TopCustomers;"
>
>             'Change Qry text (the owner for instance)
>             qt.CommandText = Replace(qt.CommandText, "DB.dbo.",
> "DB.Me")
>
>             qt.SavePassword = False
>
>             'Show new connectionstring
>             MsgBox ("Tab: " & sh.Name & vbCr & "Connection: " & vbCr &
> qt.Connection)
>             'Show new query
>             MsgBox ("Tab: " & sh.Name & vbCr & "Query: " & vbCr &
> qt.CommandText)
>
>         Next qt
>     Next sh
>
> End Sub
>
>
Author
2 Feb 2006 3:30 PM
Ade
Sorry my mistake, it does work.  You have to replace the string "Microsoft®
Query" with something else.
--
Ade


Show quote
"Ade" wrote:

> I have the exact same problem using Excel 97/MS-Query8.  I tried your
> suggestion, it did not work.  I am still getting the error.
> --
> Ade
>
>
> "preddy" wrote:
>
> > I had the same problem, but there are multiple users who use that
> > spreadsheet using Windows authentication. I did not want any of them to
> > be sysadmins. They only had SLECT permissions to certain tables. In my
> > case, deleting the Application name (from the SQL Server Login dialog)
> > fixed it. You need to click the Options button on the dialog to see
> > this. The application name seems to be an issue if it has certain
> > characters (like ®  in Microsoft® Query). Depending on the MS Office
> > version, the default value may be Microsoft® Query/MS Office XP/??.
> >
> > You can also programmatically change the connection string (and even
> > the command text if necessary). Here is a sample.
> >
> > 'ChangeConnection
> > Sub ChangeConnection()
> >
> >     Dim sh As Worksheet
> >     Dim qt As QueryTable
> >
> >     Dim sConnection As String
> >
> >     For Each sh In ActiveWorkbook.Sheets
> >         For Each qt In sh.QueryTables
> >
> >             'Show current connectionstring
> >             MsgBox ("Tab: " & sh.Name & vbCr & " Current Connection: "
> > & vbCr & qt.Connection)
> >             'Show current query
> >             MsgBox ("Tab: " & sh.Name & vbCr & "Current Query: " & vbCr
> > & qt.CommandText)
> >
> >             'Change Connection
> >             qt.Connection = "ODBC;DRIVER=SQL
> > Server;SERVER=myserver;DATABASE=myDB;Trusted_Connection=Yes;APP=Excel_TopCustomers;"
> >
> >             'Change Qry text (the owner for instance)
> >             qt.CommandText = Replace(qt.CommandText, "DB.dbo.",
> > "DB.Me")
> >
> >             qt.SavePassword = False
> >
> >             'Show new connectionstring
> >             MsgBox ("Tab: " & sh.Name & vbCr & "Connection: " & vbCr &
> > qt.Connection)
> >             'Show new query
> >             MsgBox ("Tab: " & sh.Name & vbCr & "Query: " & vbCr &
> > qt.CommandText)
> >
> >         Next qt
> >     Next sh
> >
> > End Sub
> >
> >

AddThis Social Bookmark Button