Bad INSERT INTO command???

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Noozer (dont.spam_at_me.here)
Date: 01/18/05


Date: Tue, 18 Jan 2005 09:59:33 -0700

I have an ASP page that is trying to add a record to an MS Access database,
but I'm getting a MS Jet error 80040e14. Syntax error in INSERT INTO
statement.

The INSERT command I'm using is:

  INSERT INTO Calls (Who, When) VALUES ('10.0.94.11', #1/18/2005 9:56:37
AM#)

..where "Who" is a 16 character text field and When is a General format
Date/Time field. The only other field in the Calls table is "CallID" with is
an autonumber.

Code I'm using is:

  'Create database objects
  set adoCon = server.CreateObject("ADODB.Connection")
  set rsSet = server.CreateObject("ADODB.Recordset")

  'Connect to database
  adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("Calls.mdb")

  'Add Call to database
  strSQL="INSERT INTO Calls (Who, When) VALUES ('" & AgentIP & "', #" & When
& "#);"
  rsSet.open strSQL, adoCon

...any idea's why this is happening? I believe it has something to do with
the date, but I can't figure it out.

Thx!



Relevant Pages

  • Cant mount information store
    ... MicrosoftExchange ServerDatabase Utilities ... Copyright Microsoft Corporation 1991-2000. ... Access to source database 'priv1.edb' failed with Jet error -1811. ...
    (microsoft.public.exchange2000.information.store)
  • Re: It record exists then...
    ... Dim rs As Recordset, db As Database ... Set db = CurrentDb ... Error: Syntax Error. ... If this PartNumber already exists in the InfoTbl (in the field ...
    (microsoft.public.access.formscoding)
  • Re: JET Database errors
    ... I checked the sql of the page and it appears to be correct. ... to edit any records in any databases on my server give the same error). ... a copy of JET Database update 4.0, but I'm not going to install it until I ... > The first thing I would check for is a syntax error in the UPDATE ...
    (microsoft.public.frontpage.programming)
  • Re: SQL 2005 Embedded and Moving Sharepoint Services Database
    ... Below is the command I ran, with the name of the database. ... C:\Program Files>cd microsoft sql server ... I have successfully moved some of the other databases using the OSQL command, but when I try to move this one particular database I keep getting a syntax error. ... When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. ...
    (microsoft.public.sqlserver.msde)
  • Re: Syntax error in UPDATE statement.
    ... the "syntax error" indicates that there is something wrong with the ... > Database Results Error ... Microsoft OLE DB Provider for ODBC Drivers ... > The following error message comes from the database driver software; ...
    (microsoft.public.frontpage.client)