Run-time error 2465 after database import

J

James Martin

I'm trying to tidy up a database by starting with a fresh, blank database
(Access 2000) and importing everything from the original database. Here are
the steps I've gone through:

1. Started with a blank database.

2. Set all the properties to be the same as the original database. I've set
the properties in:
- File / Database Properties
- Tools / Startup
- Tools / Options
- Visual Basic Editor - Tools / database Properties
- Visual Basic Editor - Tools / Options
- Visual Basic Editor - Tools / References

3. Selected File / Get External Data / Import and imported all tables,
queries, etc. (including checking the boxes to import relationships and
menus & toolbars).

After doing all of this I start getting odd errors in the new database that
didn't exist in the original database. Specifically I'm getting "Run-time
error 2465 ... database can't find the field 'PaddedLotNumber' referred to
in your expression". PaddedLotNumber is a function I have in one of my
modules. If I go into debug at this point and try using PaddedLotNumber in
immediate mode, I get the same error. But as soon as I click Stop to end
processing and try using PaddedLotNumber, it works fine.

Initially I assumed that this was being caused by missing or incorrect
references, but I've checked all of them and they are identical in the two
databases. I can't find any differences between the two databases. (Except,
of course, that the system tables in the fresh one are lots smaller - which
is why I'm going through this procedure in the first place.)

I've tried decompiling, compact & repair, recompiling, etc. but I continue
to get the 2465 error in the new database.

Does anyone have any suggestions as to what might be the problem?

Thanks in advance!

James
 
G

Guest

James,

What version as you importing into to? What's the old version it comes from?
Is the function the only problem you are encountering or are you getting
other issues as wel.
 
J

James Martin

Hi Maurice,

I'm not switching versions. The original database is in Access 2000 and the
new one is also Access 2000. Everything is also being done on the same
machine. I'm just trying to create a tidied-up copy of the original
database.

So far the only error I'm encountering is with the function, but I've really
tested very little. I got that error on the first thing I tried after
import, and so I haven't looked any further for other errors.

Thanks!

James
 
M

missinglinq via AccessMonster.com

Why did you decide to "tidy up" your db to begin with? Were you having any
problems with it? What is the name of the module that holds PaddedLotNumber?
It's not, perhaps, PaddedLotNumber is it? People often make the mistake of
naming the module the same as the function and this royally fouls up Access,
often leading to very odd behavior, sometimes working, sometimes not. Finally,
it might be worth the effort to make a new blank db and import everything
again, but omitting Step # 2 in your original post. Don't go setting the db
properties *before* importing. See if it runs then worry about your db
settings later. Most, if not all of them, including references, are going to
be the same if this is on the same machine, as I believe you stated.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
J

James Martin

Hi,

The immediate desire to tidy up the db was to reduce the size of the system
tables. This is a database that has been running for years and has become
quite bloated. It's only a front-end and all its data tables are in another
file, but the system tables have become colossal. Moving everything to a new
database reduces the size by almost 70%. Since we frequently have to e-mail
the front-end (don't ask), reducing the size by this much is very helpful.

The secondary reason is that I have often read suggestions that when certain
types of database corruption occur, the only solution is to start a fresh
database and import everything. I haven't had this kind of a problem, but
should it ever occur, I wanted to be prepared to do so in advance.

The name of the module that holds PaddedLotNumber is LotsUtilities.

I've tried it again, omitting step #2, and I get the same error. Then I
adjusted the references (the ones I need aren't the default) and get the
same error.

Any other thoughts?

James
 
G

Guest

James,

First thing that came to mind reading the previous post was 'If it ain't
broke don't fix it'. In your case nothing was broken but now you do have to
fix it. In other words the original isn't broken. Why not make a copy of the
original empty the tables etc.. then recompile the whole lot and then try
appending the data via appendqueries. That way you should have a cleaned up
db with fresh data.
 
J

James Martin

Hi Maurice,

The database actually has no data in it. It's just a front-end with links to
tables in another database. Well, it does have some data: the
Access-generated system tables. However, experimenting has shown those
tables to be vastly bloated. I understand that they are necessarily large,
but they are MUCH larger than they have to be. This was my attempt to reduce
the bloat. It (sort of) works, in that the fresh database at the end is
about 1/3 the size of the original. But I get this weird error.

The other reason for experimenting with this is that I have quite often read
in the newsgroups, etc. that there are times when you need to start a new
database, copy everything into it, and go from there. I haven't yet run into
a situation that warranted that action, but should such an occasion occur, I
don't want to be struggling with how to do it then when time is of the
essence.

Does the original procedure I outlined sound correct? Has anyone else done
this successfully?

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top