I have an access database.I want to add a info into a table only if it's not there.
I have this sample code which it's not 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 list=conn.execute(SQLIST)
Do While Not list.eof
If (<%=list("Day"%> = '"& lilanga &"') Then
response.write "<b> A Similar Meeting has been scheduled <\b><\p>"
list.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
I have this sample code which it's not 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 list=conn.execute(SQLIST)
Do While Not list.eof
If (<%=list("Day"%> = '"& lilanga &"') Then
response.write "<b> A Similar Meeting has been scheduled <\b><\p>"
list.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