|
my asp file can't work.
the error message "syntax error in insert statement appear"
below are my source code:
<%@Language="VBScript"%>
<%Option Explicit%>
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("project.mdb")
Dim conn,rs,sql,com,subject
com="ordering company"
subject="a new member added"
sql="INSERT INTO mail(mail,to ,from)"
sql=sql & "VALUES"
sql=sql &"('"& subject&"',"
sql=sql &"'"&com&"',"
sql=sql &"'"&Session(loginid)&"')"
'response.write(sql)
set rs=conn.Execute sql
response.redirect("/forum/content1.htm")
%>
but when i remove the ' beside the response.write(sql),i found that all the values are inserted correctly.
may anyone try to help me solve this problem.
Thanks a lot.
|
|
|
Hi
Try puting a space either side of VALUES
|
|
|
Pls. Paste the exact error and also the output of response.write(sql) statement.
|
|
|
Thanks for helping.i solve it already.
Thanks alot.
|
|
|
|
|
|
|
|