Solved

"too complex expression" error message

Posted on 2000-04-27
10
290 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
ID: 2754891
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
ID: 2754923
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
ID: 2754940
do you have relationships across your tables?
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:Galumpen
ID: 2754960
Yes.
15 tables have relationships between
them.
0
 
LVL 3

Expert Comment

by:MikeRenz
ID: 2754977
this could be part of the problem.  Do you have joins on text fields?  Are they ALL numbers (long integer, or smaller)?
0
 

Author Comment

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

Accepted Solution

by:
MikeRenz earned 300 total points
ID: 2755059
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
ID: 2755314
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
ID: 2755954
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
ID: 2756277
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

770 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