We help IT Professionals succeed at work.

Microsoft VBscript runtime error - object doesn't support this porperty or method

Medium Priority
2,791 Views
Last Modified: 2012-05-06
I am receiving the error "object doesn't support this property or method" when I try to run an asp page from our website. The page is supposed to look at a database, find your user account and then allow access to other pages.

Some history on the site. It was coded by someone else and hosted by someone different that the person who coded it. We recently moved the site to a new server and no longer have any contact with either the hoster or the coder.

I need to get this page and the login working on this site.
<%@ Language=VBScript %>
<!-- #INCLUDE FILE="data_globals.asp"-->
<% Response.Expires = 0
 
 
on error resume next
 
strUserName = trim(Request.Form("txtUserName"))
strPassword = trim(Request.Form("txtPassword"))
strErrorMsg = ""
 
If err.number <> 0 then
	wscript.echo Err.source & " - " & Err.description
End If
 
if strUserName <> "" and strPassword <> "" then
	Dim oCn, oCmd, oCmd2, oRs
	Set oCn = server.CreateObject("ADODB.Connection")
	Set oCmd = Server.CreateObject("ADODB.Command")
	oCn.Open(sDSN)
	oCmd.ActiveConnection = oCn
	oCmd.CommandText = "UserLogin"
	oCmd.CommandType = 4
	
If err.number <> 0 then
	wscript.echo Err.source & " - " & Err.description
End If
 
	oCmd.Parameters.Append oCmd.CreateParameter("UN", 129, 1, 10, strUserName)
	oCmd.Parameters.Append oCmd.CreateParameter("PW", 129, 1, 10, strPassword)
	oCmd.Parameters.Append oCmd.CreateParameter("UID", 3, 2)
 
If err.number <> 0 then
	wscript.echo Err.source & " - " & Err.description
End If
	
	oCmd.Execute
 
If err.number <> 0 then
	wscript.echo Err.source & " - " & Err.description
End If
	
	IF Err.number = 0 then	
		Session("UID") = oCmd("UID")
		
		IF Session("UID") <> "" Then
			oCmd2 = Server.CreateObject("ADODB.Command")
			oCmd2.ActiveConnection = oCn
			oCmd2.CommandText = "SelectCMSUser"
			oCmd2.CommandType = 4
			
			oCmd2.Parameters.Append oCmd2.CreateParameter("UID", 3, 1, , Cint(Session("UID")))
			
			Set oRs = oCmd2.Execute
			
			if Err.number = 0 then
				
				strUserFullName = oRs("FName") & " " & oRs("LName")
				if oRs("IsAdmin") = True then
					Session("IsAdmin") = True
				end if
				
				Set oRs = Nothing
				set oCmd = Nothing
				Set oCmd2 = Nothing
				Set oCn = Nothing
				
				Response.Redirect("main.asp")
			Else
				strErrorMsg = Err.source & " - " & Err.description
			end if
		else
			strLoginError = "Could not find the user in the database"
		end if
	else
		strErrorMsg = Err.source & " - " & Err.description
	end if
Else
	strLoginError = "Could Not Find the user in the database"
end if
 
Set oRs = Nothing
set oCmd = Nothing
Set oCmd2 = Nothing
Set oCn = Nothing
 
%>
 
<HTML>
	<HEAD>
		<TITLE>
			<%=strTitle%>
		</TITLE>
	</HEAD>
 
<LINK REL="stylesheet" TYPE="text/css" HREF="style.css">
 
<BODY>
<H1><%=strTitle%></H1>
<% if strErrorMsg = "" then %>
<table width="600">
	<tr>	
		<td class="header" align=center>
			Access Denied
		</td>
	<tr>
</table>
 
<table width="600">
	<tr>
		<td>
			<P>You could not access the CMS because<BR>
			   <%=strLoginError%>
			<P><A HREF="default.asp">Click Here to try again.</A> 
			<P>If you think that you reached this page in error<BR>
			   contact the System Administrator.
		</td>
	</tr>
	<tr><td>&nbsp;</td></tr>
 
		</td>
	</tr>
</table>
<table width="600">
	<tr>	
		<td class="header" align=center>
			Access Denied
		</td>
	<tr>
</table>
<% else %>
<P>An error was encountered during login.<BR>
<%=strErrorMsg%> <BR>
<P><A HREF="default.asp">Click Here to attemp another Login.</A>
<%End IF%> 
 
</BODY>
</HTML>

Open in new window

Comment
Watch Question

Did it give you a line number that the error occurred on?

Author

Commented:
No. The error message is "An error was encountered during login.
Microsoft VBScript runtime error - Object doesn't support this property or method


Click Here to attemp another Login.
"

Author

Commented:
I cut the vbscript portion out of the asp page and ran it. This is the error message I received.

Line: 1
Char: 1
Error: Object required: 'Request'
Code 800A01A8
Sourece: Microsoft VBScript runtime error
Try removing "on error resume next" because that will not show some potential errors.

Author

Commented:
I installed web developer 2008 on the server to try debugging the page. When I run the page and many of the other pages on the site I receive this error. "This type of page is not served

Description: The type of page you have requested is not served because is has been explicititly forbidden. The extension '.asp' may be incorrect. Please review the URL below and make sure that it is spelled correctly."

Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET:2.0.50727.3082

Author

Commented:
I removed the on error resume next and tried to access the page again and received this message.

"The website cannot display the page
 HTTP 500  
   Most likely causes:
"The website is under maintenance.
"The website has a programming error.
 
   What you can try:
     Refresh the page.
 
     Go back to the previous page.
 
     More information

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.
 
"
i don't know if VS Web Dev will serve ASP files.  I think it's primarily for ASPX (.Net).  Just comment out that line and go about viewing the page just as you were when you were getting the error earlier.

Author

Commented:
After looking at the IIS log I noted this message

"S=2|46|800a01b6|Object_doesn't_support_this_property_or_method:_'ActiveConnection'"

Author

Commented:
If I comment out the on error resume next I just get the HTTP 500 error.
above "on error resume next"

add

Response.end

refresh the page.

Then remove response.end and refresh the page.

It should give your more detail.

Author

Commented:
The page did not display any information and I did not find any error information in the event log or the iis log.
That's what will happen when you add the response.end and refresh it.

Did you then remove it and refresh the page again?

Author

Commented:
Oh okay. Sorry I misunderstood you. I performed it correctly and received this error message.

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'ActiveConnection'

/cms/validate_login.asp, line 48
Line 47 should be:

SET oCmd2 = Server.CreateObject("ADODB.Command")

you have:

oCmd2 = Server.CreateObject("ADODB.Command")

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Excellent. That was the problem. Thank you very much for the help, it is greatly appreciated.

Author

Commented:
Thanks for the help. The answer was dead on.
Glad I was able to help!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.