Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript and ActiveX: CreateObject - Permission denied

Status
Not open for further replies.

jpicks

MIS
Oct 11, 2002
158
US
I posted this to the SQL Server Forum, but have not recieved any feedback. So I thought I'd try here.

I'm using MS SQL Server.

I have a DTS package that includes several ActiveX Script Tasks that write to a log file. The package runs fine on my machine and at the server using Enterprise Manager. I created a stored procedure that executes the DTS package using xp_cmdshell. I want to be able to call the stored procedure from an asp page to allow users to execute the DTS package.

The problem I am having is that the DTS package fails when I execute it using the stored procedure. I am recieving a VBScript Runtime Error: Permission Denied.

This error is occurring when I call CreateObject in my ActiveX script:

Set fso = CreateObject("Scripting.FileSystemObject")

I found a MS Knowledge base article that said that this error is due to the fact that SQL Server Agent does not have default access permissions set in the resistry.


I changed the permissions to include Administrators and changed SQL Server Agent from a local login to an Administrator login, but it did not seem to change anything.

Has anybody else had a similar problem?
Any Suggestions?
 
Do you have some kind of anti-virus Script Blocking turned on that is specificall blocking FileSystemObject. I believe Norton has caused this problem on some machines.

But I'm also not sure about the effect of
Set fso = CreateObject("Scripting.FileSystemObject")
not going through Server.CreateObject.
Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
If it is permisiions there is a DLL from Micrsoft that allows you to impersonate a user. I use it to get around the fact that the IIS user is not a domain user, when I need to access mapped drives.

Its simple to use the entire code in you VB wouls be like this.

Set objLogon = Server.CreateObject("LoginAdmin.ImpersonateUser")
objLogon.Logon "USERNAME" , "PASSWORD", "DOMAIN"

YOUR CODE HERE

objLogon.Logoff
Set objLogon = Nothing

But I can't find the KB article on the MS site where I found this. If you want this dll reply back to this post and I'll send it to you.
 
Thanks for your replies.

-I don't have any anti-virus software running on the server.

-The code is running within a stored procedure, so it is running on the server.

-I can't logon as a different user, because the CreateObject is not supported and the stored procedure is executed by the SQL Server Agent Service. I have tried logging this service in as myself, Administrator on that box, and as a domain Administrator to no avail.

Any other ideas?

Thanks in advance.

-Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top