Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Syntax Error - Really Bugging me
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Syntax Error - Really Bugging me

 Post Reply Post Reply
Author
ziwez0 View Drop Down
Groupie
Groupie


Joined: 15 July 2002
Location: United Kingdom
Status: Offline
Points: 144
Post Options Post Options   Thanks (0) Thanks(0)   Quote ziwez0 Quote  Post ReplyReply Direct Link To This Post Topic: Syntax Error - Really Bugging me
    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


Edited by ziwez0
If anything takes long to do its worth doing.
Back to Top
Flamewave View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
Post Options Post Options   Thanks (0) Thanks(0)   Quote Flamewave Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ziwez0 View Drop Down
Groupie
Groupie


Joined: 15 July 2002
Location: United Kingdom
Status: Offline
Points: 144
Post Options Post Options   Thanks (0) Thanks(0)   Quote ziwez0 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ziwez0 View Drop Down
Groupie
Groupie


Joined: 15 July 2002
Location: United Kingdom
Status: Offline
Points: 144
Post Options Post Options   Thanks (0) Thanks(0)   Quote ziwez0 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.