Hi everybody,
I'm facing a small problem using SQL-DMO in a vbs script. This script was written for SQL 2000 and 2005 so using SMO is not really an option for me.
In SQL 2000 and SQL 2005 SP1, it looks like I have no problem doing the following from a client computer:
Dim oServer
Const cServerName = "(local)"
Const cUserName = "sa"
Const cPassword = "sa"
Set oServer = CreateObject("SQLDmo.SqlServer")
oServer.Name = cServerName
MsgBox "Status (before connection): " & oServer.Status
note that this happens *before* I connect to the server. This is because I want to start the service if is not started or wait until it is started if it is currently starting.
In SQL 2005 SP2, I get the following "Service Control Error: Access Denied", no matter what user I use...
I can only query the server's status *after* I am connected, which well, does not do much for me in that particular case ;-).
I was wondering if anybody had encountered the same problem before and if so, how they went around it. I have to confirm this, but doing this from the server itself looks like it is working... Could it then be due to a mismatch between client and server service packs or sql server backward compatibility package being required on both client and server?
Thanks,
Greg
Well, in case anybody's interested, here's what I found that proved to be the problem. It's a 2000 sp4/2003 sp1 problem. The ACL has changed and remote queries without prior connection are not allowed by default anymore. There is a fix to allow them by changing the ACL to give the required rights. In my case the fix is to try to connect anyways and if the server is not up then it will simply fail since many companies will simply not allow to do such things to get the previous behavior back .
kb Artice #: 907460
Greg
No comments:
Post a Comment