Re: How to tackle error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'



Au Zehong wrote:
Hi there,
I am experiencing a problem like the following:

------------------------------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator) in query expression 'Type=mixed developmentORDER BY id DESC'.

/_____13_/naconsult/projects.asp, line 81
-------------------------------------------------------------------------

Nothing to do with your problem but you should switch to the native Jet OLE
DB provider:
http://www.aspfaq.com/show.asp?id=2126


and my script is something like this:

-------------------------------------------------------------------------
<%

<snip>
' Set the SQL Statement to get the information from the database
strSQL="SELECT * FROM tblProjects WHERE Type=" &
Request.QueryString("dome") & "ORDER BY id DESC"
' Open the Database
<snip>
We cannot debug a sql statement unless we know what it contains. The only
way to determine this is to add this statement and run your page:

Response.Write strSQL

If the problem does not jump out at you, then post the result here.
Hint: look for a missing space.

Further points to consider:
Your use of dynamic sql is leaving you vulnerable to hackers using sql
injection:
http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23

See here for a better, more secure way to execute your queries by using
parameter markers:
http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/72e36562fee7804e

Personally, I prefer using stored procedures, or saved parameter queries
as
they are known in Access:

Access:
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: OLEDB-Fehler beim Aufrufen von "ICommandText::Execute"
    ... Severity: 16 Source: Microsoft OLE DB Provider for SQL Server Error ... Server Error message: ...
    (microsoft.public.de.german.backoffice.smallbiz)
  • Re: Connection between MDB and SQL Server
    ... Microsoft OLE DB Provider for SQL Server. ... But do I need to use the provider of Microsoft OLE DB ...
    (microsoft.public.access.modulesdaovba)
  • Re: stored procedure and recordset in ASP
    ... RS.Open SQL, ObjConn ... get rid of the Microsoft OLE DB provider. ... Sybrand Bakker, Senior Oracle DBA ...
    (comp.databases.oracle.misc)
  • Re: Sorting a recordset by a sum
    ... Microsoft OLE DB Provider for ODBC Drivers error '80040e14' ... Do you have a GROUP BY in your SQL? ...
    (microsoft.public.vb.general.discussion)
  • Re: asp recordset
    ... > Microsoft OLE DB Provider for ODBC Drivers error '80040e21' ... Why not use the native OLEDB provider? ... This email account is my spam trap so I don't check it very often. ...
    (microsoft.public.inetserver.asp.db)