CdnGal
12-03-2002, 02:49 AM
Hi, there
Can someone please try see what is wrong with my code. (newbie here taking a class) Basically it's little "form" where a user enters their e-mail address, fname, lname, password and keyword....and it's supposed to add this information to my Access Database. The error I get says "Syntax Error (missing operator) in query expression "undefined", "John""
Also, the line it "points" to is the one that says:
oC.execute(strSQL)
(John would be the fname that was entered into the form)
There are a few files involved...I'm not sure if you'll need them all to see what's causing the problem....so I've attached the one that is indicated in the syntax error.
THanks VERY much!
Majorly Confused
____________________________________
<%@language=javascript%>
<%Response.Buffer=true%>
<!--#include file="emailconx.inc"-->
<!--#include file="adojavas.inc"-->
<html><head>
<title>Add Customer</title>
</head>
<body>
<h1>Add Customer</h1>
<% var email,fname,lname,pwd,keyword,sessID,signup, SQL
email = Request.Form("email")
fname = Request.Form("fname")
lname = Request.Form("lname")
pwd = Request.Form("pwd")
keyword = Request.Form("keyword")
sessID = Session.SessionID
signup = new Date()
oC = Server.CreateObject("ADODB.connection")
oRS = Server.CreateObject("ADODB.recordset")
oC.Open(CS);
SQL = "SELECT * FROM customer"
oRS.Open(SQL,oC,adOpenDynamic,adLockOptimistic,adCmdText)
strSQL ="INSERT INTO CUSTOMER "+ "(email,sessID,fname,lname,pwd, keyword, signup)" +
" values (" +
"'" + Request.Form("email") + "','" +
"'" + Request.Form("sessID") + "','" +
"'" + Request.Form("fname") + "','" +
"'" + Request.Form("lname") + "','" +
"'" + Request.Form("pwd") + "','" +
"'" + Request.Form("keyword") + "','" +
"'" + Request.Form("signup") + "')" ;
oC.execute(strSQL)
Response.Write(SQL) ***does this need to be here? the instructor shows it
oRS.Close();
oC.Close();
%>
<a href = "CEmailADODisplay.asp">
Display the customer list </a>
</body></html>
Can someone please try see what is wrong with my code. (newbie here taking a class) Basically it's little "form" where a user enters their e-mail address, fname, lname, password and keyword....and it's supposed to add this information to my Access Database. The error I get says "Syntax Error (missing operator) in query expression "undefined", "John""
Also, the line it "points" to is the one that says:
oC.execute(strSQL)
(John would be the fname that was entered into the form)
There are a few files involved...I'm not sure if you'll need them all to see what's causing the problem....so I've attached the one that is indicated in the syntax error.
THanks VERY much!
Majorly Confused
____________________________________
<%@language=javascript%>
<%Response.Buffer=true%>
<!--#include file="emailconx.inc"-->
<!--#include file="adojavas.inc"-->
<html><head>
<title>Add Customer</title>
</head>
<body>
<h1>Add Customer</h1>
<% var email,fname,lname,pwd,keyword,sessID,signup, SQL
email = Request.Form("email")
fname = Request.Form("fname")
lname = Request.Form("lname")
pwd = Request.Form("pwd")
keyword = Request.Form("keyword")
sessID = Session.SessionID
signup = new Date()
oC = Server.CreateObject("ADODB.connection")
oRS = Server.CreateObject("ADODB.recordset")
oC.Open(CS);
SQL = "SELECT * FROM customer"
oRS.Open(SQL,oC,adOpenDynamic,adLockOptimistic,adCmdText)
strSQL ="INSERT INTO CUSTOMER "+ "(email,sessID,fname,lname,pwd, keyword, signup)" +
" values (" +
"'" + Request.Form("email") + "','" +
"'" + Request.Form("sessID") + "','" +
"'" + Request.Form("fname") + "','" +
"'" + Request.Form("lname") + "','" +
"'" + Request.Form("pwd") + "','" +
"'" + Request.Form("keyword") + "','" +
"'" + Request.Form("signup") + "')" ;
oC.execute(strSQL)
Response.Write(SQL) ***does this need to be here? the instructor shows it
oRS.Close();
oC.Close();
%>
<a href = "CEmailADODisplay.asp">
Display the customer list </a>
</body></html>