Error Creating ADODB.Connection Connection in IIS6

Error Creating ADODB.Connection Connection in IIS6

am 14.06.2005 18:51:01 von Brad Baker

We are getting the following error in IIS6 on Windows 2003 Server:

Server.CreateObject Failed
From the global.asa, the line is "Server.CreateObject("ADODB.Connection")"

This same code works fine in IIS5 on Windows 2000 Server.

We've enabled ASP, FrontPage, Internet Data Connector, & Server Side
Includes in IIS. We've also enabled network DTC and COM+ access from
add/remove program.

Both the Windows and SQL are running the latest service packs and hotfixes.
Does anyone have any ideas or suggestions? I'm sure we must be missing
something but I just can't seem to figure out what.

Thanks,
Brad

Re: Error Creating ADODB.Connection Connection in IIS6

am 14.06.2005 19:28:38 von reb01501

Brad Baker wrote:
> We are getting the following error in IIS6 on Windows 2003 Server:
>
> Server.CreateObject Failed
> From the global.asa, the line is
> "Server.CreateObject("ADODB.Connection")"
>
> This same code works fine in IIS5 on Windows 2000 Server.
>
> We've enabled ASP, FrontPage, Internet Data Connector, & Server Side
> Includes in IIS. We've also enabled network DTC and COM+ access from
> add/remove program.
>
> Both the Windows and SQL are running the latest service packs and
> hotfixes. Does anyone have any ideas or suggestions? I'm sure we must
> be missing something but I just can't seem to figure out what.
>
> Thanks,
> Brad


With that version of IIS, you no longer need to use Server.CreateObject,
which gets MTS involved. Try getting rid of the "Server." and see what
happens.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Error Creating ADODB.Connection Connection in IIS6

am 14.06.2005 20:37:33 von Brad Baker

Ok, here's my simple simple ASP page:

<%@ Language=VBScript %>





HI
<% Dim objConnection
Set objConnection=server.CreateObject("ADODB.Connection")
%>




The results of which are:
HI
Server object error 'ASP 0177 : 8007007f'

Server.CreateObject Failed

/mysite/test2.asp, line 9

8007007f


Changing line 9 to:
Set objConnection=CreateObject("ADODB.Connection")

results in:

HI error '8007007f'
/mysite/test2.asp, line 9

which is the same error.

Any other ideas?

Thanks
Brad



"Bob Barrows [MVP]" wrote in message
news:O2CxBaQcFHA.132@TK2MSFTNGP10.phx.gbl...

With that version of IIS, you no longer need to use Server.CreateObject,
which gets MTS involved. Try getting rid of the "Server." and see what
happens.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.




Brad Baker wrote:
We are getting the following error in IIS6 on Windows 2003 Server:

Server.CreateObject Failed
From the global.asa, the line is
"Server.CreateObject("ADODB.Connection")"

This same code works fine in IIS5 on Windows 2000 Server.

We've enabled ASP, FrontPage, Internet Data Connector, & Server Side
Includes in IIS. We've also enabled network DTC and COM+ access from
add/remove program.

Both the Windows and SQL are running the latest service packs and
hotfixes. Does anyone have any ideas or suggestions? I'm sure we must
be missing something but I just can't seem to figure out what.

Thanks,
Brad

Re: Error Creating ADODB.Connection Connection in IIS6

am 14.06.2005 21:12:07 von reb01501

Brad Baker wrote:
> Ok, here's my simple simple ASP page:
>
> <%@ Language=VBScript %>
>
>
>
>
>
> HI
> <% Dim objConnection
> Set objConnection=server.CreateObject("ADODB.Connection")
> %>
>
>
>
>
> The results of which are:
> HI
> Server object error 'ASP 0177 : 8007007f'
>
> Server.CreateObject Failed
>
> /mysite/test2.asp, line 9
>
> 8007007f
>
>
> Changing line 9 to:
> Set objConnection=CreateObject("ADODB.Connection")
>
> results in:
>
> HI error '8007007f'
> /mysite/test2.asp, line 9
>
> which is the same error.
>
> Any other ideas?
>
Nope. I'm assuming MDAC is installed and working on the server*. I haven't a
clue why it can't be accessed. You might try the .inetserver.iis newsgroup.
If you get a resolution there, we'd appreciate you're sharing it here.

*can you create a .vbs file containing the same code and test whether that
works?
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Error Creating ADODB.Connection Connection in IIS6

am 14.06.2005 21:44:35 von Brad Baker

Bob -

I posted the contents of this message to .inetserver.iis group. Hopefully
they will have some additional suggestions.

As for using a VB script, that seems to produce an entirely different error:

system.runtime.interopservices.COMException occured in
WindowsApplication1.exe

Brad


-------------------------------------------
"Bob Barrows [MVP]" wrote:

Nope. I'm assuming MDAC is installed and working on the server*. I haven't a
clue why it can't be accessed. You might try the .inetserver.iis newsgroup.
If you get a resolution there, we'd appreciate you're sharing it here.

*can you create a .vbs file containing the same code and test whether that
works?
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


-------------------------------------------
Brad Baker wrote:

Ok, here's my simple simple ASP page:

<%@ Language=VBScript %>





HI
<% Dim objConnection
Set objConnection=server.CreateObject("ADODB.Connection")
%>




The results of which are:
HI
Server object error 'ASP 0177 : 8007007f'

Server.CreateObject Failed

/mysite/test2.asp, line 9

8007007f


Changing line 9 to:
Set objConnection=CreateObject("ADODB.Connection")

results in:

HI error '8007007f'
/mysite/test2.asp, line 9

which is the same error.

Any other ideas?

Thanks
Brad


-------------------------------------------
"Bob Barrows [MVP]" wrote:

With that version of IIS, you no longer need to use Server.CreateObject,
which gets MTS involved. Try getting rid of the "Server." and see what
happens.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


-------------------------------------------
Brad Baker wrote:

We are getting the following error in IIS6 on Windows 2003 Server:

Server.CreateObject Failed
From the global.asa, the line is
"Server.CreateObject("ADODB.Connection")"

This same code works fine in IIS5 on Windows 2000 Server.

We've enabled ASP, FrontPage, Internet Data Connector, & Server Side
Includes in IIS. We've also enabled network DTC and COM+ access from
add/remove program.

Both the Windows and SQL are running the latest service packs and
hotfixes. Does anyone have any ideas or suggestions? I'm sure we must
be missing something but I just can't seem to figure out what.

Thanks,
Brad

RE: Error Creating ADODB.Connection Connection in IIS6

am 15.06.2005 04:16:42 von lukezhan

Hello Brad,

Can you create the "ADODB.Connection" object out of the asp application?
For example, in a VBScript app? If not, you had better reinstall MDAC on
the Server.

Also, you need to check if the ASP application is running with a powerful
account, such as a local administrator account. This may be a permission
issue regarding the error message.

Luke

Re: Error Creating ADODB.Connection Connection in IIS6

am 15.06.2005 15:38:40 von reb01501

Brad Baker wrote:
> Bob -
>
> I posted the contents of this message to .inetserver.iis group.
> Hopefully they will have some additional suggestions.
>
> As for using a VB script, that seems to produce an entirely different
> error:
>
> system.runtime.interopservices.COMException occured in
> WindowsApplication1.exe
>

What is WindowsApplication1.exe? Are you running this vbs file via a .Net
application created in VS? That is not what I intended. Put the createobject
code into a .vbs file (simply a text file with a .vbs extension). Then
simply double-click the .vbs file in Windows Explorer and see if an error is
generated.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Error Creating ADODB.Connection Connection in IIS6

am 15.06.2005 18:06:39 von Brad Baker

Thanks for all the suggestions. For some reason the system was reporting the
MDAC version as 2.8sp1 for WinXP instead of 2.8sp2 for Win2003.

Unfortunately the person I was assisting with this problem grew tired of
troubleshooting and is now reformating the system. I think that was probably
unneccesary but hopefully it will solve the problem.

If for some reason it doesn't, I will take a look at some of the suggestions
provided here and in inetserver.iis.

Thanks Again,
Brad



"[MSFT]" wrote in message
news:SAp%23TBVcFHA.3688@TK2MSFTNGXA01.phx.gbl...
> Hello Brad,
>
> Can you create the "ADODB.Connection" object out of the asp application?
> For example, in a VBScript app? If not, you had better reinstall MDAC on
> the Server.
>
> Also, you need to check if the ASP application is running with a powerful
> account, such as a local administrator account. This may be a permission
> issue regarding the error message.
>
> Luke
>

Re: Error Creating ADODB.Connection Connection in IIS6

am 15.06.2005 19:10:55 von mmcginty

"Bob Barrows [MVP]" wrote in message
news:O2CxBaQcFHA.132@TK2MSFTNGP10.phx.gbl...
>
> With that version of IIS, you no longer need to use Server.CreateObject,
> which gets MTS involved. Try getting rid of the "Server." and see what
> happens.

Ugh you've got to be kidding! Why didn't they just add a method to the
Server object, I wonder?

Is there still a compelling reason to use Server.CreateObject vs just
CreateObject in IIS5? I know the latter works, but seem to remember it was
once desirable to call the former


To the OP, have you tried creating a connection object in a regular ASP
file? Server 2003 has issues with apartment threaded objects stored as
static Application objects. I know Recordset is apartment threaded by
default, you have to run a registry script that comes with it to make it
free threaded. Maybe 2003 applies that same logic to any object created
inside of global.asa?


-Mark



> Bob Barrows
> --

Re: Error Creating ADODB.Connection Connection in IIS6

am 15.06.2005 19:46:04 von reb01501

Mark J. McGinty wrote:
> "Bob Barrows [MVP]" wrote in message
> news:O2CxBaQcFHA.132@TK2MSFTNGP10.phx.gbl...
>>
>> With that version of IIS, you no longer need to use
>> Server.CreateObject, which gets MTS involved. Try getting rid of the
>> "Server." and see what happens.
>
> Ugh you've got to be kidding! Why didn't they just add a method to
> the Server object, I wonder?
>

Huh? I think you misunderstood me. The Server object has a CreateObject
method. VBScript also has its own CreateObject method. The difference is
explained here:
http://blogs.msdn.com/ericlippert/archive/2004/06/01/145686. aspx

> Is there still a compelling reason to use Server.CreateObject vs just
> CreateObject in IIS5? I know the latter works, but seem to remember
> it was once desirable to call the former
>

In IIS4 it was always advised to use the Server's version, becuase it got
MTS involved. In IIS 5+, the pendulum has swung towards the VBScript
version.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Error Creating ADODB.Connection Connection in IIS6

am 21.06.2005 03:34:02 von Kurt Hobson

I am actually seeing the same problem on our DEV server, and it started
around the same time this initial thread started 6/13/2005). When we left on
Friday everything was fine, and when we came in Monday our ASP site was
unable to create any sort of ADODB object. The only thing that had changed
over the weekend was that SP1 for Windows Server 2003 had been installed
automatically Sunday morning. After banging our heads against a wall for a
while, we simply uninstalled SP1 and of course the site started working
without a hitch. Reapplying the SP1 brought it down again.

Any thoughts? We saw it happen on one other box briefly last week but
otherwise have been having a hard time replicating the issue on other boxes
or fixing the one DEV box. Our fear is that if SP1 makes it way onto our
production boxes that we will be hozed.

FYI some code that breaks:

<%
dim rs
set rs = Server.CreateObject("ADODB.Recordset")
%>

and the error:
Server object error 'ASP 0177 : 8007007f'
Server.CreateObject Failed
/ktest.asp line 12
8007007f

thanks,

-Kurt

Re: Error Creating ADODB.Connection Connection in IIS6

am 21.06.2005 05:44:33 von jeff.nospam

On Mon, 20 Jun 2005 18:34:02 -0700, "Kurt Hobson" Hobson@discussions.microsoft.com> wrote:

>I am actually seeing the same problem on our DEV server, and it started
>around the same time this initial thread started 6/13/2005). When we left on
>Friday everything was fine, and when we came in Monday our ASP site was
>unable to create any sort of ADODB object. The only thing that had changed
>over the weekend was that SP1 for Windows Server 2003 had been installed
>automatically Sunday morning. After banging our heads against a wall for a
>while, we simply uninstalled SP1 and of course the site started working
>without a hitch. Reapplying the SP1 brought it down again.
>
>Any thoughts? We saw it happen on one other box briefly last week but
>otherwise have been having a hard time replicating the issue on other boxes
>or fixing the one DEV box. Our fear is that if SP1 makes it way onto our
>production boxes that we will be hozed.
>
>FYI some code that breaks:
>
><%
> dim rs
> set rs = Server.CreateObject("ADODB.Recordset")
>%>
>
>and the error:
>Server object error 'ASP 0177 : 8007007f'
>Server.CreateObject Failed
>/ktest.asp line 12
>8007007f


Might start here:

http://www.aspfaq.com/show.asp?id=2362

Jeff

Re: Error Creating ADODB.Connection Connection in IIS6

am 21.06.2005 19:43:06 von KurtHobson

I think have have found the root of the problem, but not what caused it.
Using the MDAC Component Checker, I was able to determine that a slew of the
ado/ole registry entries are out of whack. I tried re-regging a couple as
Jeff suggested, but received the 'LoadLibrary failed' message. I also tried
reapplying SP1, which made no difference.

I suppose I could correct all the reg entries by hand..... but that seems a
bit extreme. Any other thoughts?

thanks,

-Kurt

"Jeff Cochran" wrote:

> On Mon, 20 Jun 2005 18:34:02 -0700, "Kurt Hobson" > Hobson@discussions.microsoft.com> wrote:
>
> >I am actually seeing the same problem on our DEV server, and it started
> >around the same time this initial thread started 6/13/2005). When we left on
> >Friday everything was fine, and when we came in Monday our ASP site was
> >unable to create any sort of ADODB object. The only thing that had changed
> >over the weekend was that SP1 for Windows Server 2003 had been installed
> >automatically Sunday morning. After banging our heads against a wall for a
> >while, we simply uninstalled SP1 and of course the site started working
> >without a hitch. Reapplying the SP1 brought it down again.
> >
> >Any thoughts? We saw it happen on one other box briefly last week but
> >otherwise have been having a hard time replicating the issue on other boxes
> >or fixing the one DEV box. Our fear is that if SP1 makes it way onto our
> >production boxes that we will be hozed.
> >
> >FYI some code that breaks:
> >
> ><%
> > dim rs
> > set rs = Server.CreateObject("ADODB.Recordset")
> >%>
> >
> >and the error:
> >Server object error 'ASP 0177 : 8007007f'
> >Server.CreateObject Failed
> >/ktest.asp line 12
> >8007007f
>
>
> Might start here:
>
> http://www.aspfaq.com/show.asp?id=2362
>
> Jeff
>

Re: Error Creating ADODB.Connection Connection in IIS6

am 20.07.2005 23:52:01 von Aaric

Has anyone found a fix for this?

I have a client who we just moved their existing site over to a Windows 2003
Server and are having this very problem. I had them try and reinstall MDAC
2.8. This did not fix the issue. I remoted in and downloaded MDAC Component
Checker and ran it. When I had it try and determine what version was running
it was unable to do so. So, I specified which version and it told me that
several of the registry keys were wrong. I am not to the point where I want
to try and fix the registry myself manually.

Thanks for the help.

-Aaric