I want to add records to a table and make sure that I do not add it when it's there.I have three fields I campare with and I get the following error message
Syntax error
/scheduletake.asp, line 18, column 4
and I have this section from the beginning of the file
where I think the error is.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<%@ Language = VBscript %>
<%
'Grab variables from the querystring.
lilanga = Request.Form("Days"
ummango = Request.Form("Comms"
lusuku = Request.Form("Tikhatsi"
set conn = Server.CreateObject("ADODB.Connection"
conn.Open "SKPE"
SQLIST="SELECT * FROM schedule"
set cars1=conn.execute(SQLIST)
Do While not cars1.eof
if (<%=cars1("Day"
%> = '"& lilanga &"') and (<%=cars1("Community"
%> ='"& ummango &"') and (<%=cars1("ScheduledTime"
%>='"& lusuku &"') then response.write "<b> A Similar Meeting has been scheduled <\b><\p>"
cars1.movenext loop
else
SQL="INSERT INTO schedule (Day,Officer,TaskToPerform,Department,ScheduledTime,DateofTask,Duration,Community) Values (" &_
"'" & request.form("Days"
& "', " &_
"'" & request.form("Officers"
& "', " &_
"'" & request.form("Details"
& "', " &_
"'" & request.form("Departments"
& "', " &_
"'" & request.form("Tikhatsi"
& "', " &_
"'" & request.form("Dates"
& "', " &_
"'" & request.form("Durations"
& "', " &_
"'" & request.form("Comms"
& "')"
set cars=conn.execute(SQL)
end if
Syntax error
/scheduletake.asp, line 18, column 4
and I have this section from the beginning of the file
where I think the error is.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<%@ Language = VBscript %>
<%
'Grab variables from the querystring.
lilanga = Request.Form("Days"
ummango = Request.Form("Comms"
lusuku = Request.Form("Tikhatsi"
set conn = Server.CreateObject("ADODB.Connection"
conn.Open "SKPE"
SQLIST="SELECT * FROM schedule"
set cars1=conn.execute(SQLIST)
Do While not cars1.eof
if (<%=cars1("Day"
cars1.movenext loop
else
SQL="INSERT INTO schedule (Day,Officer,TaskToPerform,Department,ScheduledTime,DateofTask,Duration,Community) Values (" &_
"'" & request.form("Days"
"'" & request.form("Officers"
"'" & request.form("Details"
"'" & request.form("Departments"
"'" & request.form("Tikhatsi"
"'" & request.form("Dates"
"'" & request.form("Durations"
"'" & request.form("Comms"
set cars=conn.execute(SQL)
end if