30

I'm running a SQL Server 2005 database from a VB 6 Application. I connect to the database through an ODBC DSN.

I renamed the computer on which I'm running the default instance of SQL server from 'Software' to 'IT'. I then ran the sp_dropserver and sp_addserver stored procedures to rename the instance.

On restarting the SQL Server service, the server was able to pick up on the new SQL Server name.

After configuring the ODBC data source name to the new name, the connection was Ok. I'm able to run my application and read records through ADO record sets. However I'm unable to update any recordset using the .Update method. I get the following error instead ... SQL Server not configured for data access

How can I enable data access on the renamed server instance?

gotqn
  • 42,737
  • 46
  • 157
  • 243

5 Answers5

51

How to: Rename a Computer that Hosts a Stand-Alone Instance of SQL Server 2005

You should be able to run this but not against any linked server. It's not a linked server. It's local.

EXEC sp_serveroption 'YourServer', 'DATA ACCESS', TRUE
gbn
  • 422,506
  • 82
  • 585
  • 676
5

Just go to the linked server properties > Server options > Data access --> true

Works on SQL Server 2014.

Regards

Redit0
  • 370
  • 1
  • 14
Ljuba Buinjac
  • 61
  • 1
  • 4
3

with this

use master
go

exec sp_serveroption 'server name', 'data access', 'true'
go 

linked servers generated for replication still showing same error

3

I just would like to add to the previous answers that, at least in my case here, I needed to enable data access in both places.

for instance:

there is server A and server B

On server A I have a linked server LB that links me from server A to server B

I need to execute the following:

-- on server A

exec sp_serveroption 'LB', 'data access', 'true'

-- on server B

exec sp_serveroption 'B', 'data access', 'true'
Marcello Miorelli
  • 3,368
  • 4
  • 44
  • 67
2

I've just come across this error and found that it was caused by me trying to run OpenQuery against the local server (doh!). Changing the server name to that of an actual linked server resolved my issue.

Neil P
  • 2,920
  • 5
  • 33
  • 64