If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > vbs works, asp doesn't

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-19-03, 04:40
csmsam csmsam is offline
Registered User
 
Join Date: Dec 2002
Posts: 3
vbs works, asp doesn't

I have a script which connects to an Exchange server, and calculates the size of a mailbox.

When I run this script as asp on my own IIS, it works. When I copy it to a front-end exchange server if fails. When I copy it to a back-end exchange server it also fails. If I run the same script as vbs is runs fine, thus I arrived at the conclusion that the problem lies in the IIS running on the Exchange servers.

The script fails on the line
"cmd.ActiveConnection = con"

The script is

<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<SCRIPT LANGUAGE=vbscript RUNAT=Server>

dim con
dim cmd

set con = server.createObject("ADODB.Connection")
set cmd = server.CreateObject("ADODB.Command")

con.Provider="MSDAIPP.DSO"
con.ConnectionString="User ID=test" & _
";Password=test" & _
";Data Source=http://exchangeserver" & _
".domain.co.xx/exchange/test"
con.Open
cmd.ActiveConnection = con
con.Close

set con = nothing
set cmd = nothing

</SCRIPT>

</BODY>
</HTML>
Reply With Quote
  #2 (permalink)  
Old 02-22-03, 02:14
Bunce Bunce is offline
Registered User
 
Join Date: Jul 2002
Location: Australia
Posts: 147
Have you checked that IIS is running on the exchange server?
__________________
There have been many posts made throughout the world.
This was one of them.
Reply With Quote
  #3 (permalink)  
Old 02-23-03, 00:48
csmsam csmsam is offline
Registered User
 
Join Date: Dec 2002
Posts: 3
There is IIS on the Exchange Server, only it's the default one installed while installing Exchange, so it isn't exactly the same as a regular IIS.
Do you know of anything specific to look for?
Reply With Quote
  #4 (permalink)  
Old 02-23-03, 03:14
Bunce Bunce is offline
Registered User
 
Join Date: Jul 2002
Location: Australia
Posts: 147
Whats the actual error message? Perhaps its a permissions issue..

Cheers,
Andrew
__________________
There have been many posts made throughout the world.
This was one of them.
Reply With Quote
  #5 (permalink)  
Old 02-23-03, 03:19
csmsam csmsam is offline
Registered User
 
Join Date: Dec 2002
Posts: 3
The error message is

Microsoft OLE DB Provider for Internet Publishing (0x80004005)
Unspecified error

and it occurs on the line
cmd.ActiveConnection = con

The con.open works.

Don't forget - this works fine in vbs.

Thanks,
Caroline
Reply With Quote
  #6 (permalink)  
Old 02-23-03, 03:25
Bunce Bunce is offline
Registered User
 
Join Date: Jul 2002
Location: Australia
Posts: 147
Yes but you need to remember that by default, anonymous WEB requests run under the context of IUSR_<MachineName> local account, whereas a VBS file would run under the current user.

You may have different permissions on the machine that the script works on..

I must admit I've only connected to exchange using LDAP and not the provider you are using, however my gut feeling is that it could be a permissions issue.

Is there anywhere in exchange where you can alter permission for this type of access?

Cheers,
Andrew
__________________
There have been many posts made throughout the world.
This was one of them.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On