Link to home
Start Free TrialLog in
Avatar of marconovaro
marconovaro

asked on

Help DAO with network database... :(


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.
Avatar of rpai
rpai

Please maintain your open questions:-
Questions Asked 3
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
Avatar of marconovaro

ASKER


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
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



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

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
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 ?


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.
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.

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.
ASKER CERTIFIED SOLUTION
Avatar of ComTech
ComTech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial