Solved

Help DAO with network database... :(

Posted on 2002-06-17
13
719 Views
Last Modified: 2008-02-26

Hi,
I have the following problem. I'm using DAO to read a database that is shared on a PC featuring Windows NT 4.00; this only reads a database on a shared directory (network file system). I currently have to support this version (i.e. I can't use ADO or RDO...)
Now, I want to check for network problems. If I disconnect and re-connect the network cable, trying to access the database gives me an error. This error is managed in the error handler like this:

DBEngine.Idle
myDb.Close
set myDb = Nothing
set myDb = OpenDatabase( ... )

But this does not seem to work correctly. I still get the error 3043 "Disk or network error".
Any suggestion about this is greatly appreciated.... Please HELP ME I'm quite desperate :(

Thank you very much in advance.
Marco.
0
Comment
Question by:marconovaro
13 Comments
 
LVL 5

Expert Comment

by:rpai
ID: 7083910
Please maintain your open questions:-
Questions Asked 3
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
0
 
LVL 5

Expert Comment

by:rpai
ID: 7083915
0
 
LVL 6

Author Comment

by:marconovaro
ID: 7083925

Dear rpai,
thanks for the reply. I already checked it, and it's fine. Furthermore, I'm using VB6.0 enterprise...
For the open questions, I still didn't received any useful reply, that I can accept as as answer to them. That's why they are still open... :)
Regards
0
 
LVL 5

Expert Comment

by:rpai
ID: 7083964
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7083991
Two things

1. have you tried to map the share path to a drive or using UNC

2. If the cable is disconnect and then reconnect, when you detect an error occur, try to only access the \\computername and then access the fullpath of database.

ie \\computername\...\mydb.mdb


0
 
LVL 6

Author Comment

by:marconovaro
ID: 7084034

Hi EDDYKT,
thanks for the reply. Answers:

1. the share is mapped as a UNC (\\server\...). Is there any difference using a drive?

2. In which way could I access the \\computername without accessing the database? Sorry if this is a stupid answer! ... Why should I do this, in your opinion?

Thanks again. I really appreciate your help.

P.S. rpai, yes, I checked also that MSKB article... Thanks
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Author Comment

by:marconovaro
ID: 7084044

Hi EDDYKT,
thanks for the reply. Answers:

1. the share is mapped as a UNC (\\server\...). Is there any difference using a drive?

2. In which way could I access the \\computername without accessing the database? Sorry if this is a stupid answer! ... Why should I do this, in your opinion?

Thanks again. I really appreciate your help.

P.S. rpai, yes, I checked also that MSKB article... Thanks
0
 
LVL 6

Expert Comment

by:pierrecampe
ID: 7084646
if you disconnect the cable windows loses the connection to the shared drive/directory
if you reconnect the cable windows may take a long time to reconnect to the shared drive/directory
after reconnecting the cable can you see/access the shared drive/directory ?

0
 
LVL 6

Author Comment

by:marconovaro
ID: 7086138

Ok, here is more information on my system:

the client is talking to a ActiveX EXE on the server via DCOM. This periodically sends events to the client for it to know the network is good.
When the client doesn't receive an event (+ timeout), it blocks saying that the server is unreacheable. When the events are received again, the client restarts working.

When I restart working, I can see the shared directory. In fact if I close the client during the disconnection, and then I open it again, it works correctly. But, the problem arises when I try to "reopen" the database (as explained above).

Thanks to everybody for your contribution.
0
 
LVL 1

Expert Comment

by:Vinda
ID: 7087427
Try this, it worked for me atleast...

myDb.Close
set myDb = Nothing
DBEngine.Idle dbRefreshCache
set myDb = OpenDatabase( ... )

Even we are connecting to a network databse using a UNC path, and we passed the disconnect and re-connect network cable in our test lab.
0
 
LVL 6

Author Comment

by:marconovaro
ID: 7091856

Ok, I found myself the correct answer. Here it is, for everybody who may need it.
In the error handler, I put this code:

DBEngine.Idle dbRefreshCache
DoEvents
myDb.Close
set myDb = Nothing

set myDb = OpenDatabase( ... )
DBEngine.Idle dbRefreshCache
DoEvents

And this works fine! :)
The database was opened correctly, and all subsequent operations was successful.
Thanks to everybody for your replies.
Marco.
0
 

Accepted Solution

by:
ComTech earned 0 total points
ID: 7092481
This qustion will be placed in PAQ, as the answer has been found by User.

Regards,
ComTech
CS @ EE
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 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

16 Experts available now in Live!

Get 1:1 Help Now