?
Solved

Help DAO with network database... :(

Posted on 2002-06-17
13
Medium Priority
?
776 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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