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:
set conn = CreateObject("ADODB.Connection")
conn.open "<connection string>"
' notice the flip flop of strSQL -> SQLstr
strSQL = "UPDATE table SET dt = CURRENT_TIMESTAMP"
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. Reply with quote