Print Page | Close Window

Syntax Error - Really Bugging me

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5939
Printed Date: 30 March 2026 at 3:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Syntax Error - Really Bugging me
Posted By: ziwez0
Subject: Syntax Error - Really Bugging me
Date Posted: 24 September 2003 at 7:48am
OK i keep getting the following error...

Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/demo/db/update1.asp, line 10

ive checked the field names and they are all correct, here is the code...

<% Language=VBScript %>
<%
Dim Conn, dbPath
  dbPath = Server.MapPath("/DEMO/db/specialoffersdb.mdb")
  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0; DATA SOURCE=" & dbPath

conn.Execute "INSERT INTO Special02 (location,Date-D,Hotel,Desc) VALUES('" & Request.form("Loc") & "','" & Request.form("dat1") & "','" & Request.form("hot1") & "','" & Request.form("desc1") & "')"
Response.Redirect "UpdateConfirm.asp"
Conn.close
%>

any help is much greatful


-------------
If anything takes long to do its worth doing.



Replies:
Posted By: Flamewave
Date Posted: 24 September 2003 at 9:03am

try this:

conn.Execute "INSERT INTO Special02 (location,Date-D,Hotel,Desc) VALUES('" & Request.form("Loc") & "','#" & cdate(Request.form("dat1")) & "#','" & Request.form("hot1") & "','" & Request.form("desc1") & "')"

I am assuming that Date-D is a datetime field.



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: ziwez0
Date Posted: 24 September 2003 at 9:17am
Cheers Buddy,

ive kinda changed the code..

<!--#include file="Topv1.asp" -->

<% Language=VBScript %>
<%
Dim Conn, dbPath
  dbPath = Server.MapPath("/DEMO/db/specialoffersdb.mdb")
  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0; DATA SOURCE=" & dbPath


conn.Execute "INSERT INTO Special02 (location1,Depart,Hotel,info) VALUES('" & Request.form("Locate1") & "','#" & Request.form("depart") & "#','" & Request.form("accom1") & "','" & Request.form("about1") & "')"


Response.Redirect "UpdateConfirm.asp"
Conn.close
%>
<!--#include file="bottomv2.asp" -->

but i get this message (date-d, is now depart, depart is manually entered text)

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

/demo/db/update6.asp, line 11

here is the code that is sending to this page

Enter New product details.<P>
<form action="update6.asp" method="post">
<TABLE BORDERCOLOR="BLUE" BORDER="0" CELLPADDING="2" BGCOLOR="BLUE"><tr><td>

<Table class="main_font" CELLPADDING="0" CELLSPACING="4" bgcolor="#D6E4FC"><tr>
<td>Location:</td>
<TD>
<Input type="text" value="" name="locate1">
</select>
</td></tr>
<tr><TD>
Date:</td><td><Input type="text" value="" name="depart"></td></tr>
<tr><td>Hotel:</td><td>
<Input type="text" value="" name="accom1">
</td></tr>
<tr><td>
Description:</td><td><Input type="text" value="" name="about1"></td></tr>

<tr><td></td><td>
<Input type="Submit" value="Update" class="form_fields"></td></tr>
</table>
</td></tr>
</TABLE>
</centre>
</form>




-------------
If anything takes long to do its worth doing.


Posted By: ziwez0
Date Posted: 24 September 2003 at 10:19am
Sorted out the problem, after a few hours, F***ing web host does and does not support DSN-Less connection, you cant pull out info out you cant add any to it!
never use crapnet i mean easynet.com (bunch of cowboys)



-------------
If anything takes long to do its worth doing.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net