Dear All,
Ive been battling with below codes. All I want is to update the "Student" table ni MS-Access. I use DNS-less connectoin. the error i keep getting "Too few parameters. Expected 2" error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/CourseSelector/Admin/stud_edition.asp, line 16
Line 16 is "myConn.execute sql"
====================================================
here is my update code:
<%
Dim myConn, rsEducation , sql,strStudentId, strSurname, strForename, strCohortId, strEducation1, strEducation2
ID=Request.Form("ID")
set myConn=Server.CreateObject("ADODB.Connection")
myConn.Open "Student"
set rsEducation = Server.CreateObject("ADODB.Recordset")
strSurname= Request.Form("Surname")
strForename= Request.Form("forenames")
strEducation1= Request.Form("education1")
strEducation2= Request.Form("education2")
SQL = "UPDATE [students] SET Students.Surname=('"& strSurname&"'), Students.forename=('"& strForename&"'), Students.education1=('"& strEducation1&"'), Students.education2=('"& strEducation2&"') WHERE Students.StudentID =" & ID & ";"
myConn.execute sql
%>
<p><b><font face="Tahoma" color="#666666">Student Educational background is upadted ! </font></b></p>
<p> </p>
<input type="button" value=" << Back " onClick="javascript:window.navigate('editstud.asp')">
</body>
</html>
Dan
Ive been battling with below codes. All I want is to update the "Student" table ni MS-Access. I use DNS-less connectoin. the error i keep getting "Too few parameters. Expected 2" error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/CourseSelector/Admin/stud_edition.asp, line 16
Line 16 is "myConn.execute sql"
====================================================
here is my update code:
<%
Dim myConn, rsEducation , sql,strStudentId, strSurname, strForename, strCohortId, strEducation1, strEducation2
ID=Request.Form("ID")
set myConn=Server.CreateObject("ADODB.Connection")
myConn.Open "Student"
set rsEducation = Server.CreateObject("ADODB.Recordset")
strSurname= Request.Form("Surname")
strForename= Request.Form("forenames")
strEducation1= Request.Form("education1")
strEducation2= Request.Form("education2")
SQL = "UPDATE [students] SET Students.Surname=('"& strSurname&"'), Students.forename=('"& strForename&"'), Students.education1=('"& strEducation1&"'), Students.education2=('"& strEducation2&"') WHERE Students.StudentID =" & ID & ";"
myConn.execute sql
%>
<p><b><font face="Tahoma" color="#666666">Student Educational background is upadted ! </font></b></p>
<p> </p>
<input type="button" value=" << Back " onClick="javascript:window.navigate('editstud.asp')">
</body>
</html>
Dan