Re: ASP Error - Syntax Error
This is probably because you are trying to insert values into a column that does not allow NULL values.
You can change this setting in SQL enterprise manager.
Let me know if you still have problems.
Re: ASP Error - Syntax Error
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db1.mdb")
Is there anything wrong with this line of codes?
Thank you, cause i did add in values into the required fields.
Re: ASP Error - Syntax Error
Are you using javascript as your ASP language? If not, you are using a wrong syntax to concatenate string. Use "+" for javascript, use "&" for vbscript.
Try this:
strSQL = "insert into course values ('" & request.form("dNAME") & "','" & request.form("cNAME") & "'," & request.form("cNO") & ");"
Re: ASP Error - Syntax Error
Make sure they arent null also, especially the Number Field ..
VB Code:
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("./db1.mdb")
strSQL = "INSERT INTO course (dNAME, cNAME, cNO) VALUES ('" & request.form("dNAME") & "','" & request.form("cNAME") & "'," & request.form("cNO") & ");"
adoCon.Execute(strSQL)