SQL string too long?

  • Thread starter Thread starter Brian McBride
  • Start date Start date
B

Brian McBride

In Access 2000, is there a limit to the number of
characters I can use to set the SQL property of a pre-
existing querydef. I'm creating a string of just less than
3000 characters and although I don't get an error when I
apply it to the SQL property and try to run the query, it
doesn't return the correct values when I open a recordset
based on the query - even after refreshing the Querydefs
collection.
 
I believe there is a limit and I think building the string like so will get
round the problem:

strSQL = "aldkjf;lakdjf;lakjsd;flakjf;lajd;fjas;dlfjaf"
strSQL = strSQL & " fdgdfgdgdgdgdgdfgfgdgdgdg"
strSQL = strSQL & " adklja;dlkjfa;lkdjfa;ldjf"

HTH
Al
 
It is likely to be something else since the SQL String can be up to 64K
character. In addition, if the String is too long, 99.9% sure you get an
error, not the wrong values.
 
Yea, I've made some pretty monstrous strings and never maxed a limit. If it's
there, it must be big.
(e-mail address removed)
 
Back
Top