Application Crash

Z

Zafar Salim

Hi all,

I ve developed an application in MSAccess97 and it was working fine. Had to
make a small and simple change which I did, and after that it crashs when I
try to run it. Have also undone the change I made but, still it crashes.

When I tried compiling the code it throws up the following error :

"Compile error : Function or interface marked as restricted, or the function
uses an Automation type not supported in Visual Basic."

at the following line of Code :

Set db = CurrentDb

By the way, I have checked Microsoft DAO 3.6 in References.

Will appreciate any kind of help possible.

Regards,
Zafar
 
A

Allen Browne

DAO 3.6 is designed for JET 4 (Access 2000 and later).
Uncheck that reference, and use DAO 3.51 instead.

After that, compact the database. Then decompile by entering something like
this at the command prompt while Access is not running. It is all one line,
and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact again.

There's a summary of the references for each version of Access here:
http://allenbrowne.com/ser-38.html
 
Z

Zafar Salim

Thanks Allen, for your response.

Did everything you wrote. Now there is no problem at the compiling stage but
it crashes when I run the App.

Interestingly, when I import all the modules into a MSAccessXP mdb on
another machine, it works properly.

Could you guide me further?

Regards,
Zafar
 
A

Allen Browne

It could be a corruption.

You could try creating a new (blank) Access 97 database, and then importing
everything from the faulty database:
File | Get External | Import.

If this occurs with a particular form, you could try this
1. Make a backup of the mdb while Access is not running.

2. Copy the text from the form's module to notepad, and save as a text file.

3.Set the form's HasModule property to No. Save. Compact the database.

4. Open the Immediate window (Ctrl+G), and enter:
SaveAsText acForm, "Form1", "C:\Form1.txt"
substituting the name of your form for Form1.

5. Delete the form from your database. Compact again.

6. Import the form again:
LoadFromText acForm, "Form1", "C:\Form1.txt"

7. Test if the form works without crashing your database.
If so, open its module, and paste in the text you saved at step 2.

More suggestions for deailing with corruption:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html
 
Z

Zafar Salim

Thanks again, Allen.

Tried importing tables, queries, forms, reports and modules into a blank A97
mdb as suggested. It did throw up an error when importing the tables. Did
not show any specific table. The others were imported without any problem.
It still crashes!

By the way, many of the tables are linked from other databases. Tried
removing the links and tried to run it. It still crashes!

Is there a possibility of A97 being corrupted ?

Regards,
Zafar
 
A

Allen Browne

If you believe your installation of Access 97 is bad, you could remove it
and reinstall it. Or you could test your idea by seeing if:
a) other databases run okay on this machine, and
b) this database has problems on other machines.
 
Z

Zafar Salim

Allen,

I re-installed Office 97 and it is working fine now.

Thankyou very much for your guidance.

Regards,
Zafar
 

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

Top