Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ODBC Drivers error '80040e14'  - driving me nuts!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ODBC Drivers error '80040e14' - driving me nuts!

 Post Reply Post Reply
Author
zaxdada View Drop Down
Newbie
Newbie
Avatar

Joined: 28 February 2009
Location: PA
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaxdada Quote  Post ReplyReply Direct Link To This Post Topic: ODBC Drivers error '80040e14' - driving me nuts!
    Posted: 28 February 2009 at 8:07pm
I am new at asp so go slow. I have 2 different forms writing to 2 different access databases (Thanks to Web Wiz!). The one works fine - the other is giving me the following error code:
-------------------------------------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

/Bridal/add_to_registry.asp, line 30

--------------------------------------------------------------------------------
I have been over the code - comparing the 2 asp pages - and the only changes I made are the names of the fields, db, table, etc. The one which works is being used for a guestbook app and this one is for a registration app. The db and asp files are in the same directory. Names are: db - main
                   table - bgreg
                   form - form
Any help would be appreciated!!
Here's the code (with comments):
---------------------------------------------------------------------------------
<%
'Dimension variables
Dim adoCon    'Holds the Database Connection Object
Dim rsAddReg  'Holds the recordset for the new record to be added to the database
Dim strSQL       'Holds the SQL query for the database
 
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
 
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("main.mdb")
 
'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=main"
 
'Create an ADO recordset object
Set rsAddReg = Server.CreateObject("ADODB.Recordset")
 
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblbgreg.bride_first, tblbgreg.bride_last, tblbgreg.bride_add, tblbgreg.bride_city, tblbgreg.bride_state, tblbgreg.bride_zip, tblbgreg.groom_first, tblbgreg.groom_last, tblbgreg.groom_add, tblbgreg.groom_city, tblbgreg.groom_state, tblbgreg.groom_zip, tblbgreg.b_parentsname, tblbgreg.b_parentscity, tblbgreg.b_parentsstate, tblbgreg.b_parentszip, tblbgreg.g_parentsname, tblbgreg.g_parentscity, tblbgreg.g_parentsstate, tblbgreg.g_parentszip, tblbgreg.engagement, tblbgreg.wedding, tblbgreg.location, tblbgreg.comments, tblbgreg.email, tblbgreg.password, tblbgreg.timestamp, FROM tblbgreg;"
 
'Set the cursor type we are using so we can navigate through the recordset
rsAddReg.CursorType = 2
 
'Set the lock type so that the record is locked by ADO when it is updated
rsAddReg.LockType = 3
 
'Open the tblbgreg table using the SQL query held in the strSQL varaiable
rsAddReg.Open strSQL, adoCon
 
'Tell the recordset we are adding a new record to it
rsAddReg.AddNew
 
'Add a new record to the recordset
rsAddReg.Fields("bride_first") = Request.Form("bride_first")
rsAddReg.Fields("bride_last") = Request.Form("bride_last")
rsAddReg.Fields("bride_add") = Request.Form("bride_add")
rsAddReg.Fields("bride_city") = Request.Form("bride_city")
rsAddReg.Fields("bride_state") = Request.Form("bride_state")
rsAddReg.Fields("bride_zip") = Request.Form("bride_zip")
rsAddReg.Fields("groom_first") = Request.Form("groom_first")
rsAddReg.Fields("groom_last") = Request.Form("groom_last")
rsAddReg.Fields("groom_add") = Request.Form("groom_add")
rsAddReg.Fields("groom_city") = Request.Form("groom_city")
rsAddReg.Fields("groom_state") = Request.Form("groom_state")
rsAddReg.Fields("groom_zip") = Request.Form("groom_zip")
rsAddReg.Fields("b_parentsname") = Request.Form("b_parentsname")
rsAddReg.Fields("b_parentscity") = Request.Form("b_parentscity")
rsAddReg.Fields("b_parentsstate") = Request.Form("b_parentsstate")
rsAddReg.Fields("b_parentszip") = Request.Form("b_parentszip")
rsAddReg.Fields("g_parentsname") = Request.Form("g_parentsname")
rsAddReg.Fields("g_parentscity") = Request.Form("g_parentscity")
rsAddReg.Fields("g_parentsstate") = Request.Form("g_parentsstate")
rsAddReg.Fields("g_parentszip") = Request.Form("g_parentszip")
rsAddReg.Fields("engagement") = Request.Form("engagement")
rsAddReg.Fields("wedding") = Request.Form("wedding")
rsAddReg.Fields("location") = Request.Form("location")
rsAddReg.Fields("comments") = Request.Form("comments")
rsAddReg.Fields("email") = Request.Form("email")
rsAddReg.Fields("password") = Request.Form("password")
rsAddReg.Fields("timestamp") = Request.Form("timestamp")

'Write the updated recordset to the database
rsAddReg.Update
 
'Reset server objects
rsAddReg.Close

Set rsAddReg = Nothing
Set adoCon = Nothing
'Redirect to the index.htm page
Response.Redirect "index.htm"
%>
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 02 March 2009 at 9:33am
There are certain words which are reserved words in certain databases, these words can not be used for table names.

In your case with Access it maybe the table called 'timestamp' that needs to be renamed. However have a look online to find a list of reserve words for Access and make sure you are not using any of these reserved words for table or field names.
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.