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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Required" ?

Status
Not open for further replies.

Reynet01

Technical User
Apr 27, 2004
59
US
Can someone tell me what is wrong here I don't do this enough to be good at it and I am pulling my hair out!
Thanks
<%
Dim LicenseLookup1__tpclic
LicenseLookup1__tpclic = "%"
If (Request.form("frmtpclicense") <> "") Then
LicenseLookup1__tpclic = Request.form("frmtpclicense")
End If
if (Activatedcheck1.Fields.Item(licenseNumber).Value)<>"" and (Activatedcheck1.Fields.Item(activated).Value)=1 then
Session("license")="activated"
Session("age")=50
response.redirect("step1.asp")
end if
%>

If knowledge were power I would be a AAA battery!
 
make sure Activatedcheck1 has been set

Set Activatedcheck1 = Server.CreateObject "ADODB.Recordset")
 
Sorry my statement is below is the full code basically what I want to is on the activatedcheck1 recordset if it finds the license number and the activated field is 1 "its a text field" then I want it to set
Session("license")="activated"
Session("age")=50
response.redirect("step1.asp")


if finds the record and the activaed field is empty I want it to continue Thanks for any help!

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/RS1.asp" -->
<%
Session("username")="validuser"
Session("age")=50
%>
<%
Dim Recordset1__tpclic
Recordset1__tpclic = "TPC-0000-0000-0000"
'Redirect if TPC license code is missing
if (Request.form ("frmtpclicense") = "") then
Session("license")="empty"
Session("age")=50
response.redirect("step1.asp")
Recordset1__tpclic = Request.form ("tpclicense")
end if

%>

<%machineid=Request.form("frmMachineId")
siteid=request.form("frmSiteCode")
tpclicense=request.form("frmtpclicense")%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_RS1_STRING
Recordset1.Source = "SELECT TPCLicense, MachineId, SiteCode, Activated FROM dbo.Activated_Licenses WHERE tpclicense='tpclic'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim LicenseLookup1__tpclic
LicenseLookup1__tpclic = "%"
If (Request.form("frmtpclicense") <> "") Then
LicenseLookup1__tpclic = Request.form("frmtpclicense")

%>
<%
Dim LicenseLookup1
Dim LicenseLookup1_numRows

Set LicenseLookup1 = Server.CreateObject("ADODB.Recordset")
LicenseLookup1.ActiveConnection = MM_RS1_STRING
LicenseLookup1.Source = "SELECT licenseNumber, activated FROM dbo.tpclicenses WHERE licenseNumber='" + Replace(LicenseLookup1__tpclic, "'", "''") + "'"
LicenseLookup1.CursorType = 0
LicenseLookup1.CursorLocation = 2
LicenseLookup1.LockType = 1
LicenseLookup1.Open()

LicenseLookup1_numRows = 0
If LicenseLookup1.eof then
Session("license")="nogood"
Session("age")=50
response.redirect ("step1.asp")
end if
%>
<%
Dim Activatedcheck1__vartpclic
Activatedcheck1__vartpclic = "TPC-4577-8369-1559"
If (request.form("tpclicense") <> "") Then
Activatedcheck1__vartpclic = request.form("tpclicense")
End If
%>
<%
Dim Activatedcheck1
Dim Activatedcheck1_numRows
Set Activatedcheck1 = Server.CreateObject("ADODB.Recordset")
Activatedcheck1.ActiveConnection = MM_RS1_STRING
Activatedcheck1.Source = "SELECT licenseNumber, activated FROM dbo.tpclicenses WHERE Licensenumber='" + Replace(Activatedcheck1__vartpclic, "'", "''") + "' and activated=1"

Activatedcheck1.CursorType = 0
Activatedcheck1.CursorLocation = 2
Activatedcheck1.LockType = 1
Activatedcheck1.Open()
If not Activatedcheck1.EOF then
Session("license")="activated"
Session("age")=50
response.redirect("step1.asp")
else
end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p align="center"><strong><font color="#0000FF" size="5">Your License Number Has Been Confirmed</font></strong></p>
<p align="center"><font color="#0000FF" size="4">Please enter your registration
information below</font></p>
<p align="center">&nbsp;</p>
<p align="center"><font color="#000000" size="2">All Information is for registration
purposes only you must provide valid information to receive technical and customer
support.</font><font color="#FF0000"></font></p>
<form name="form1" method="post" action="step3.asp">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CC99CC">
<tr>
<td colspan="3"><div align="center"><font color="#FF0000" size="5">*</font><font color="#000000"><strong><font color="#FFFFFF">All
Fields Are Required</font></strong><font color="#FF0000" size="5">*</font></font></div></td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="12%"><div align="right"><strong>First Name--</strong></div></td>
<td colspan="2"> <input name="frmfirstname" type="text" id="frmfirstname" size="30" maxlength="30">
</td>
<td width="1%">&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>Last Name--</strong></div></td>
<td colspan="2"><input name="frmLastname" type="text" id="frmLastname3" size="30" maxlength="30"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>Address1--</strong></div></td>
<td colspan="2"><input name="frmaddress" type="text" id="frmaddress3" size="30" maxlength="30"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>Address2--</strong></div></td>
<td colspan="2"><input name="frmaddress1" type="text" id="frmaddress13" size="30" maxlength="30"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>City--</strong></div></td>
<td colspan="2"><input name="frmCity" type="text" id="frmCity3" size="30" maxlength="30"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<div align="right"><strong>State--</strong></div></td>
<td colspan="2"><input name="frmState" type="text" id="frmState3" size="2" maxlength="2">
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>Zipcode--</strong></div></td>
<td colspan="2"><input name="frmZipCode" type="text" id="frmZipCode3" size="10" maxlength="10"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>Phone--</strong></div></td>
<td colspan="2"> <input name="frmPhone" type="text" id="frmPhone3"> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>E-mail--</strong></div></td>
<td colspan="2"><input name="frmemail" type="text" id="frmemail3" size="40" maxlength="40"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>MachineID--</strong></div></td>
<td colspan="2"> <%response.write machineid%> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="right"><strong>SiteCode--</strong></div></td>
<td colspan="2"> <%response.write siteid%> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td width="40%"><div align="center">
<input name="checkbox" type="checkbox" value="1" checked>
<strong>Alert me of product updates</strong></div></td>
<td width="47%"><input type="submit" name="Submit" value="Register"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2"><div align="center"> </div></td>
<td>&nbsp;</td>
</tr>
</table>
<p align="center"><font color="#FF0000"><strong>WE DO NOT SELL OR SHARE THIS
INFORMATION TO ANYONE!</strong></font></p>
<p><font color="#FF0000">
<input name="frmtpclicense" type="hidden" value="<%response.write tpclicense%>">
<input name="frmVersion" type="hidden" id="frmVersion" value="V5">
<input name="frmMachineID" type="hidden" id="frmMachineID" value="<% response.write machineid %>">
<input name="frmSiteCode" type="hidden" id="frmSiteCode" value="<% response.write siteid%>">
</font></p>
</form>
<p>&nbsp;</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
LicenseLookup1.Close()
Set LicenseLookup1 = Nothing
%>
<%
Activatedcheck1.Close()
Set Activatedcheck1 = Nothing
end if
%>




If knowledge were power I would be a AAA battery!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top