Hi everyone,
I've been playing around with this again to see if I can get it working but it keeps returning the following error:
Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
lcbooth/writeable/addnew.asp, line 44, column 135
Line 44 is my sql statement (I've attached my code below) but I can't see anything wrong!!
Does anybody have any ideas/suggestions? I've been trying to get this working for 2 days now!!
<%@ Language=VBScript %>
<html>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<head>
<SCRIPT TYPE="text/javascript">
<!--
function targetopener(mylink, closeme, closeonly)
{
if (! (window.focus && window.opener))return true;
window.opener.focus();
if (! closeonly)window.opener.location.href=mylink.href;
if (closeme)window.close();
return false;
}
//-->
</SCRIPT>
<title>AddNew</title>
</head>
<body>
<center><p>Careplan</p>
<%
set oConn = Server.CreateObject("ADODB.Connection")
oConn.Provider="Microsoft.Jet.OLEDB.4.0"
name=Request.Form("ObjectiveID")
name=Request.Form("CategoryNo")
name=Request.Form("StudentID")
name=Request.Form("StudentSurname")
name=Request.Form("RevNo")
name=Request.Form("Goal")
name=Request.Form("Action")
name=Request.Form("Outcome")
Call oConn.Open(Server.Mappath("FinalProject.mdb"))
If Request.Form("submit") = "submit" Then
sSQL = "INSERT INTO Tblcareplan (ObjectiveID,CategoryNo,StudentID,StudentSurname,R evNo,Goal,Action,Outcome) VALUES "(" & Request.Form("ObjectiveID") & "," & Request.Form("CategoryNo") & "," & Request.Form("StudentID") & ",'" & Request.Form("StudentSurname") & "',"& Request.Form("RevNo") & ",'"& Request.Form("Goal") & "','"& Request.Form("Action") & "','"& Request.Form("Outcome") &"')"
oConn.Execute sSQL
%><p>Details added into the database - thanks.<br><a href= "staffhome.html">Home</a>
<%
End If
oConn.Close
Set oConn = Nothing
%>
<p>Details added into the database - thanks.</p><br><a href= "staffhome.html">Home</a>
<%
oConn.Close
Set oConn = Nothing
%>
<p class=subheading><a href="staffhome.html" onClick="return targetopener(this)">Back to Staff Homepage</a></p>
</body>
</html>
Thanks in advance...