[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2347
  • Last Modified:

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

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

0
MainSail2007
Asked:
MainSail2007
  • 10
  • 7
1 Solution
 
BrandonGalderisiCommented:
Did it give you a line number that the error occurred on?
0
 
MainSail2007Author 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.
"
0
 
MainSail2007Author 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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
BrandonGalderisiCommented:
Try removing "on error resume next" because that will not show some potential errors.
0
 
MainSail2007Author 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
0
 
MainSail2007Author 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.
 
"
0
 
BrandonGalderisiCommented:
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.
0
 
MainSail2007Author Commented:
After looking at the IIS log I noted this message

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

0
 
MainSail2007Author Commented:
If I comment out the on error resume next I just get the HTTP 500 error.
0
 
BrandonGalderisiCommented:
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.
0
 
MainSail2007Author Commented:
The page did not display any information and I did not find any error information in the event log or the iis log.
0
 
BrandonGalderisiCommented:
That's what will happen when you add the response.end and refresh it.

Did you then remove it and refresh the page again?
0
 
MainSail2007Author 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
0
 
BrandonGalderisiCommented:
Line 47 should be:

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

you have:

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

0
 
MainSail2007Author Commented:
Excellent. That was the problem. Thank you very much for the help, it is greatly appreciated.
0
 
MainSail2007Author Commented:
Thanks for the help. The answer was dead on.
0
 
BrandonGalderisiCommented:
Glad I was able to help!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 10
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now