Why do I get 80040E0C errors?
|
| View previous topic :: View next topic |
| Author |
Message |
Zorro Guest
|
| Why do I get 80040E0C errors? |
| |
|
|
|
|
tom Guest
|
| Code: |
Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'
Command text was not set for the command object. |
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: |
<%
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)
' ...
%> |
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. |
| |
|
|
|
|