response.write strSQL shows no values!
Hi,
I am trying to do simple insert into an access database.
I am receiving the error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
When I response.write strSQL I receive the following:
INSERT INTO module1 (course,employee,comp,rma) VALUES (
Why are there no values?
When response.write the individual variables as you can see I have done in the code below, all appear fine above the insert into statement.
Full Code:
<%@ Language=VBScript %>
<%
course=request.form("course")
employee=request.form("employee")
comp=request.form("comp")
rma=request.form("rma")
response.write course & employee & comp & rma & "<br>"
Dim adoCon
Dim ObjRS
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database/license.mdb")
Set objRS = Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO module1 (course,employee,comp,rma) VALUES ("' & course & "', '" & employee & "','" & comp & "', '" & rma & "');"
response.write strSQL
objRS.Open strSQL, adoCon
emp_no=request.form("employee")
response.redirect "http://intranet/health_safety/Store_H&S_Combined/LTT/rma_add.asp?emp_no=" & Request.form("employee")
%>
<html>
<head>
<title>New Page </title>
<meta name="Microsoft Border" content="tl, default">
</head>
<body>
</body>
</html>
Any ideas why this is not inserting into the database successfully?
Thanks in advance.
|