web hosting and development forums
Web Design and Development Forums Archive


Index - ASP in depth

Why do I get 80040E0C errors?


Post reply

Why do I get 80040E0C errors?
[code:1]Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'
Command text was not set for the command object.[/code:1]


This error is usually caused by an empty SQL statement (and does not necessarily deal with the explicit ADODB.Command object). Here is a sample piece of code that will cause this error:

[code:1]<%
set conn = CreateObject("ADODB.Connection")
conn.open "<connection string>"

' notice the flip flop of strSQL -> SQLstr

strSQL = "UPDATE table SET dt = CURRENT_TIMESTAMP"
conn.execute(SQLstr)

' ...
%>[/code:1]

Using Option Explicit would prevent errors like this from happening (well, actually, using Option Explicit would just cause a different error). Using quick and sensible debugging practices will help determine the cause of many SQL-related errors.




Dubai Forum | Paris Forum | Webmaster Forum | Vegan Forum | Brisbane Forum | 3D Forum | Jobs in Dubai | Jobs in London | London UK Classifieds
Archive script by RedHo.com