Friday, February 24, 2012

Error 2571 - not permission to run DBCC TRACEON

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
To run DBCC Traceon you requires membership in the sysadmin fixed
server role.
Regards
Amish
|||That did it! Thanks !!!
"amish" wrote:

> To run DBCC Traceon you requires membership in the sysadmin fixed
> server role.
>
> Regards
> Amish
>
|||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 =AE in Microsoft=AE Query). Depending on the MS Office
version, the default value may be Microsoft=AE 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 =3D "ODBC;DRIVER=3DSQL
Server;SERVER=3Dmyserver;DATABASE=3DmyDB;Trusted_C onnection=3DYes;APP=3DExc=
el_TopCustomers;"
'Change Qry text (the owner for instance)
qt.CommandText =3D Replace(qt.CommandText, "DB.dbo.",
"DB.Me")
qt.SavePassword =3D 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
|||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_Conne ction=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
>
|||Sorry my mistake, it does work. You have to replace the string "Microsoft?
Query" with something else.
Ade
"Ade" wrote:
[vbcol=seagreen]
> 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:

No comments:

Post a Comment