Solved

Help DAO with network database... :(

Posted on 2002-06-17
13
728 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 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

21 Experts available now in Live!

Get 1:1 Help Now