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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error accessing file-Error

Status
Not open for further replies.

ckaspar

IS-IT--Management
Jun 5, 2003
51
US
I am getting an error in my Access 2000 database that does not allow any VBA code to be run.

The error says

Microsoft Visual Basic

Error accessing file. Network connection may have been lost.

OK Help

OK takes me to the debug screen and Help does not show anything.

What does this mean?

I have tried exporting all of the objects to a new database but that does not even work.

I have it on everything I run.

Please help.
 
When it takes you to the VBA code, what is the line that is highlighted?

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
i use to experience this a lot.

it is normally down to importing code from another database .i.e forms with vba or modules.

after this has happened then you get error access file sometimes with network connecitons may have been lot.

in office 2000 it can sometimes happen when you are using ms office sr1 .. you need to upgrade to sr3

if you cant do this.

import from a good copy of your mdb.

after you have imported all forms modules tables etc...

before you do anything else

press alt+f11 (this will take you to the vb window)

in here goto the debug menu and then compile.

close database and reopen.

the problem should have disappeared.
I use this day in day out.
good luck

RTB
 
I am going through the identical problem but having trouble. After getting the "Error Accessing File..." message, I tried the fix offered by uSoft Knowledge Base Article # 304548, which identifies the problem as the presence of a DLL by the name of Vbe6, version 6.3.91.8 and tells you to do the following on a networked computer that does NOT have this DLL: (a) copy the code behind each form, report or code module to text files, (b) save the forms/reports with the "Has Module:No" option, (c)make a new db, (d) import the now codeless items to it, (e)open the code window & restore the code via cut&paste from the text files, & save the items with the code, and then re-create the modules using the text-file-saved code. After following these steps, I get another problem--a compile error: "User-defined type not defined", with the following VBA statement highlighted in yellow:
"Global MyDB As Database, MySet As Recordset, MyWorkSpace as Workspace". Thinking that the text file format may have "confused" Access, I tried emptying the VB window and re-typing the above statement in the window directly, and noticed a very curious thing--Access has a "helper" drop-down list appearing after the keyword "As", listing all the various types variable names can be assigned to, but the word "Database" is ABSENT! So is the type "Workspace", indicating that Access no longer recognizes these two data types--EVEN THOUGH PREVIOUSLY WORKING CODE CONTAINED THESE KEYWORDS BEFORE THE PROBLEM OCCURRED! This explains the compile error, but gets me no closer to the solution. I tried re-entering the declarations module alone, which contained the above statement, & compiling it and got the same error. Interesting enough, I can no longer export previously-working versions of the forms to the database where the trouble occurred: after performing the export or import operation, the form does not appear in the database's list of available forms.

Can someone Offer any Solution to this? specifics follow:

We are running Access 2000, all with SR-1 on a networked system--one server running Windows Server 2000 and three client machines, two running Windows 98 and one running Windows 2000 professional.

Thank you in advance for any help you can give me.
 
I have seen this error at two times.

The first is when the network connection is truly lost or renamed. You can correct this using Tools>DatabaseUtilities>Link Table Manager and refresh links/location.

The second case is a little misleading. Here is the scenario.
If you copy a form, report or code module or you import the same or if you rename any of these modules, the next step is to compile the source code.

If you fail to do this, Access may get confused and the source code becomes unusable. This is a bug in Access 2000 and on. If this happens, access thinks it can not find the source code for the form and then becomes corrupt and gives you the 'Network' error message.

Once this 'Network error message pops up' at least one of the code modules is bad and you will not be able to recover unless you have a good backup version. So, backups are important.

Try This:
1) Open a form or report in design view
2) Open up the code window
3) Select Debug>Compile Database
4) If it compiles, then this is probably not your problem
but, if it can not open and compile all modules, then you have a code problem. (sounds like you have already done this)

Importing or Exporting can not fix this issue if the code is bad.

You could try the Standalone 'Compact' utility from microsoft:

or

You can try:
1) If you have a backup copy, use it. I make copies of my access mdb almost hourly so if something like this happens, I can get a good copy quickly.

or (If you do not have a backup copy)

2) Create a new, blank Access mdb and try to import all objects except the one bad form from the Db in question.

Also:
open a code window, select Tools>References and make sure all references are good.

Note:
What you need to do to prevent this in the future:
Whenever you copy, import or rename an object with VBA code, the very next step is to open a code window and compile the source. This error started showing up in Access 2000. It was not an issue in Access 97. (Note: The error message is misleading, but is telling you that Access can not find the code module)


Good Luck,
Hap...

Access Developer [pc] Access based Add-on Solutions
Access Consultants forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top