Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL query "too complex" 1

Status
Not open for further replies.

Albuckj2

Programmer
Jan 7, 2003
68
GB
I'd really appreciate it if someone could help me with this problem.

I have a form with a large number of elements in one select box (just over 700). All 700 of these may be submitted. I've found that this can't be done via the "GET" method because the maximum length of a URL is something like 2,083 characters (in IE). All the data gets across to the other page via the POST method, but my SQL query run via ASP on the next page doesn't run. An error says:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Query is too complex.

I've checked the SQL string which I'm attempting to execute and it's syntax is fine, it's just that it has some 300+ (up to 700 in some cases) different WHERE conditions

e.g.
COLOR = "BLACK" OR COLOR = "RED" OR COLOR = "BLUE" OR COLOR = "WHITE" OR etc....

So is there a maximum query length? If so what is it? I can't find this info anywhere. Is there any way round it????

Cheers for any help,

Alex.
 
What I've been doing is putting the inputs into a form variable then submitting them to another page. So far I haven't hit any limits and you can pass some BIG querys from my pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top