Solved

"too complex expression" error message

Posted on 2000-04-27
10
288 Views
Last Modified: 2009-07-29
I've got an Access-97 database that was
autoconverted from an Access 2.0 database.
Every now and then (when the database
is getting too large) i get the error
message

"This expression is typed incorrectly,
or it is too complex to be evaluated.
For example,a numeric expression may
contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables"

when I try to open a form, or even enter
the database.

If I run a "compact database" the
problem dissapears for a week or so,
until the database has grown larger.
Then it pops up again.

What exactly is my problem?
Does this occur because it is an
autoconverted base, or is there
somthing I can do about it?
0
Comment
Question by:Galumpen
10 Comments
 
LVL 6

Expert Comment

by:simonbennett
Comment Utility
Hi there..

Do you have anything running in the Autoexec macro? If so, what does it do?

It sounds like you have some code somewhere like...

Do while not rs.eof
   str = str & "'" & rs![FieldName] & "',"
   rs.movenext
loop

str = left(str,len(str)-1)
SQL = SQL & " WHERE Field IN(" & str & ")"

....or similar.

Does any line of code get highlighted? (Im guessing no, otherwise you would have mentioned it)

How large is your .mdb at the moment? Acc97 can handle up to 1GB (but would return a different message I would have though)

Any other info?

Good Luck

Simon
0
 

Author Comment

by:Galumpen
Comment Utility
The only thing the autoexec does, is to
hide the databasewindow, open
the main menu form, and movesize.

The database is appr. 100Mb.
0
 
LVL 3

Expert Comment

by:MikeRenz
Comment Utility
do you have relationships across your tables?
0
 

Author Comment

by:Galumpen
Comment Utility
Yes.
15 tables have relationships between
them.
0
 
LVL 3

Expert Comment

by:MikeRenz
Comment Utility
this could be part of the problem.  Do you have joins on text fields?  Are they ALL numbers (long integer, or smaller)?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Galumpen
Comment Utility
Most of the joins are between text fields.
A couple is between autonumber.
0
 
LVL 3

Accepted Solution

by:
MikeRenz earned 300 total points
Comment Utility
you should not join text fields.  This is a HUGE no-no.  The tables which are joined by text fields, add ID fields (either number, or autonumber (depending on the type of table) and then make the joins on these ID fields.  It may take a little while to add all this to your database (a lot of update queries), but the speed increase should be dramatic.

This 'should' fix your complexity issue also.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
The problem is is that there are certain built in limits for how much memory is used to process queries.  In A2, only a 64K segment was available.  Starting with A95, this restriction was removed, but it's still possible to bump into the limit (the limit seems to float and has never been documented, so it's hard to pin down).

  There is also a limit on the length of an SQL statement.

  As Mike suggested, fixing the joins is the first step and probably will be the only!

Good luck!
Jim.

0
 
LVL 9

Expert Comment

by:perove
Comment Utility
You could also also try to import the whole database into a new one, the autoconverter are not completly perfect, by doint this all the "sysobjects"  are "fresh" and this might do the trick!

Also upgrade to SP-2 for office if this is not done

perove

0
 
LVL 7

Expert Comment

by:JimMorgan
Comment Utility
One of the first things that I would do is to 'decompile' the DB and then recompile it.  This fixes a multitude of sins.

Add /Decompile to the command line to call Access.  If the program runs when opened, hold down the shift key to prevent it from starting.  When the decompile is finished, immediately quit Access.

Open Access normally, holding down the shift key so that it will not run.  Open any code module and 'Compile and Save All'.  If there are any major snafus from the autoconversion from Access 2.0, this should catch them.

Please be sure that you have all the service packs and service releases up to date.  That is SP-2b for Access and SR-3 for Jet.

Jim
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now