HakanAzaklioglu
Mar 16th, 2000, 10:36 PM
Syntax error... can't figure it out...
Here is the code:
<%@ Language=VBScript %>
<%
set conn = server.createobject ("adodb.connection")
conn.open "HYTECH"
if not IsEmpty(Request.Form("NewsRem")) then
conn.Execute "delete from NewsDB where MsgDsc = " & Request.Form("NewsRemove")
elseif not IsEmpty(Request.Form("NewsUpd")) then
Response.Redirect "./update.asp?EmployeeID=" & Request.Form("NewsUpdate")
end if
set RSNewsRemove = conn.Execute("select * from NewsDB ORDER BY Date ")
Do Until RSNewsRemove.Eof
OptionString = OptionString & "<OPTION VALUE=""" & RSNewsRemove("PostedBy") & """>" & RSNewsRemove("Date") & ", " & RSNewsRemove("MsgDsc") & "</OPTION>"
RSNewsRemove.MoveNext
Loop
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY bgcolor="#FFFFFF">
<form method="post" action="">
<table width="500" border="0" cellspacing="5" cellpadding="5">
<tr bgcolor="#CC0000">
<td>
<p><font face="Tahoma, Arial" color="#FFFFFF"><b>Product News (Admin)</b></font></p>
</td>
</tr>
</table>
<hr width="498" align="left">
<table width="500" border="0" cellspacing="5" cellpadding="5" vspace="0">
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">
<input type="submit" name="NewsAdd" value="Add News">
</font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial"></font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right">
<input type="submit" name="NewsUpd" value="Update News">
</div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC">
<select name="NewsUpdate">
</select>
</td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">
<input type="submit" name="NewsRem" value="Remove News">
</font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"> <font face="Tahoma, Arial">
<select name="NewsRem" style="color: #000080; text-transform: uppercase; font-size: 8pt; font-family: Arial; font-style: italic" size="1" >
<% response.write OptionString %>
</select>
</font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Current
Date: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC">
<input type="text" name="textfield">
</td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Current
Time: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial">
<input type="text" name="textfield2">
</font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Current
Articles Posted: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial">
<input type="text" name="textfield3">
</font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Last
Article Posted On: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial">
<input type="text" name="textfield4">
</font></td>
</tr>
</table>
<p>*</p>
</form>
<p>*</p>
<P></P>
</BODY>
</HTML>
Here is the code:
<%@ Language=VBScript %>
<%
set conn = server.createobject ("adodb.connection")
conn.open "HYTECH"
if not IsEmpty(Request.Form("NewsRem")) then
conn.Execute "delete from NewsDB where MsgDsc = " & Request.Form("NewsRemove")
elseif not IsEmpty(Request.Form("NewsUpd")) then
Response.Redirect "./update.asp?EmployeeID=" & Request.Form("NewsUpdate")
end if
set RSNewsRemove = conn.Execute("select * from NewsDB ORDER BY Date ")
Do Until RSNewsRemove.Eof
OptionString = OptionString & "<OPTION VALUE=""" & RSNewsRemove("PostedBy") & """>" & RSNewsRemove("Date") & ", " & RSNewsRemove("MsgDsc") & "</OPTION>"
RSNewsRemove.MoveNext
Loop
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY bgcolor="#FFFFFF">
<form method="post" action="">
<table width="500" border="0" cellspacing="5" cellpadding="5">
<tr bgcolor="#CC0000">
<td>
<p><font face="Tahoma, Arial" color="#FFFFFF"><b>Product News (Admin)</b></font></p>
</td>
</tr>
</table>
<hr width="498" align="left">
<table width="500" border="0" cellspacing="5" cellpadding="5" vspace="0">
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">
<input type="submit" name="NewsAdd" value="Add News">
</font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial"></font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right">
<input type="submit" name="NewsUpd" value="Update News">
</div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC">
<select name="NewsUpdate">
</select>
</td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">
<input type="submit" name="NewsRem" value="Remove News">
</font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"> <font face="Tahoma, Arial">
<select name="NewsRem" style="color: #000080; text-transform: uppercase; font-size: 8pt; font-family: Arial; font-style: italic" size="1" >
<% response.write OptionString %>
</select>
</font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Current
Date: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC">
<input type="text" name="textfield">
</td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Current
Time: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial">
<input type="text" name="textfield2">
</font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Current
Articles Posted: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial">
<input type="text" name="textfield3">
</font></td>
</tr>
<tr valign="middle">
<td width="199" height="40" bgcolor="#000000">
<div align="right"><b><font face="Tahoma, Arial" color="#FFFFFF">Last
Article Posted On: </font></b></div>
</td>
<td width="264" height="40" bgcolor="#CCCCCC"><font face="Tahoma, Arial">
<input type="text" name="textfield4">
</font></td>
</tr>
</table>
<p>*</p>
</form>
<p>*</p>
<P></P>
</BODY>
</HTML>