PDA

View Full Version : Search Error!


tsbarnes
01-13-2003, 08:38 PM
Hey everyone,

I am working on a search page that searches my db. I get a strange error when I press enter on my keyboard, however I do not get the error when I click search in my search form. The error reads:

Microsoft JET Database Engine error '80040e0c'

Command text was not set for the command object.

/bl/search/searchresults1.asp, line 57

This is the code for line 57:

Set rstSearch = objConn.Execute(strSQL)


has anyone ever seen this error? What could be causing this?

Thanks in Advance,

Thomas S. Barnes

arnyinc
01-13-2003, 10:26 PM
What is strSQL equal to? You appear to be missing something in your SQL string.

Without seeing any code, the only difference (that I can think of) between hitting enter or clicking search would be triggering a submit or an onclick event. When you hit enter that will immediately submit the form. When you click the button, it might be a plain button with an onclick event that submits it.

bostjank
01-13-2003, 10:56 PM
The problem is that strSQL hasn't got any value --> strSQL = ""

This my be caused by:
a) you haven't set any SELECT statement to strSQL
b) you have mistyped the variable name, containing SELECT statement

Bostjan

tsbarnes
01-14-2003, 07:44 PM
bostjank,

You were absolutely right. Due to some bad coding if certain criteria wasn't met it would set my StrSQL to an empty value.

Thanks,

tsbarnes