Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 29th, 2006, 09:08 AM
Authorized User
 
Join Date: May 2006
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error 0x80040E14

Hi,
I receive the following error, but struggling to resolve this issue.

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/TheBranch/added.asp, line 97

Line 97 reads: myCon.Execute(mySQL)

Heres the SQL stuff to:
<%
Dim mySQL, myName, mySurname, myAge, myStatus, myEmail, myPword, myPhone
Dim myTown, myCountry, myWork, myDesc
myName = Request.Form("BrfName")
mySurname = Request.Form("BrSurname")
myAge = Request.Form("BrAge")
myStatus = Request.Form("BrStatus")
myEmail = Request.Form("BrEmail")
myPword = Request.Form("BrPword")
myPhone = Request.Form("BrPhone")
myTown = Request.Form("BrTown")
myCountry = Request.Form("BrCountry")
myWork = Request.Form("BrWork")
myDesc = Request.Form("BrDesc")
mySQL = "INSERT INTO tbl_Branch " _
    & "(BrfName, BrSurname, BrAge, BrStatus, BrEmail, BrPword, BrPhone) " _
    & "(BrTown, BrCountry, BrWork, BryDesc) " _
    & "SELECT '" & myName & "' AS BrfName, '" _
    & mySurname & "' AS BrSurname, '" _
    & myAge & "' AS BrAge, '" _
    & myStatus & "' AS BrStatus, '" _
    & myEmail & "' AS BrEmail, '" _
    & myPword & "' AS BrPword, '" _
    & myPhone & "' AS BrPhone, '" _
    & myTown & "' AS BrTown, '" _
    & myCountry & "' AS BrCountry, '" _
    & myWork & "' AS BrWork, '" _
    & myDesc & "' AS BrDesc;"
myCon.Execute(mySQL)
myCon.Close
Set myCon = Nothing
%>
Any help most appreciated. TIA:)
 
Old May 30th, 2006, 09:48 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have several syntax problems.

The format of an insert statement is like this:

INSERT INTO TableName (Column List) VALUES (Value List)

Where:
TableName is the table you are inserting into
Column List is a comma delimited list of the fields you are inserting values into
And Value list is a comma delimited list of the values that are to be inserted into the fields.

So... you have several problems.
I would suggest that you work out your sql insert statement in some database tool (like Access or Slq Server query analyzer) and then make your script create that statement.

For example you have the following bit of code:
Code:
& "(BrfName, BrSurname, BrAge, BrStatus, BrEmail, BrPword, BrPhone) " _
    & "(BrTown, BrCountry, BrWork, BryDesc) " _
That should be like this:
Code:
(BrfName, BrSurname, BrAge, BrStatus, BrEmail, BrPword, BrPhone, BrTown, BrCountry, BrWork, BryDesc)
without the extra parenthisis in the middle... and so on.

Woody Z http://www.learntoprogramnow.com
 
Old May 30th, 2006, 11:37 AM
Authorized User
 
Join Date: May 2006
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi and thanks for the response.
I've managed to get the correct SQL in place and it now works. Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM
0x80040e14 error socket Classic ASP Databases 0 January 27th, 2005 10:22 AM
Microsoft JET Database Engine (0x80040E14) Syntax Greywacke Classic ASP Databases 1 February 14th, 2004 01:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.