Network Connection Problem

DRW
08-31-2009, 03:16 AM
Hello All

I have been trying to track down a problem for a few months. I am running a VB6 app over a network with an access97 database. I know, LEGACY! I am tidying up and will move to SQL server later in the year.

Here is the problem.

When running across a network some terminals carry on functioning when there is a network disconnect. Even to the point of producing documents from the system from records which subsequently do not exists on the server database. Weird or what?

I have by pure chance experienced something similar on my office network. This morning my wife tripped the power when using a dodgy iron. (A rare occasion). My server and terminal are on a UPS but the router is not. My app continued to work even when the network was down.

I find that if I run my app and open the customer form, flick through the first 10 or so customer records, then literally pull out the power supply to my router, I can select one of the customer records that I had previously viewed and all appears as normal! It’s like the network is still connected and I can use the records.

The programme is opening a recordset based on a database object that is not connected.

If I try to view a record that was not previously viewed when the connection was ok then I get a 'Disk or Network error (3043).

I assume that the data must be being cached locally, to save network traffic and increase speed of retrieval.

The problem is that if there is a network problem when a user is creating an invoice then I want the error to occur when the network is lost. I don't want the invoice table to be updated and an invoice printed from a local cache of data if the network database is not being updated.

Any ideas on how to solve this?

:confused:

vb5prgrmr
08-31-2009, 06:05 AM
Move the cursor from client to server... (You may also want to do a refresh/requery prior to doing any operations based on current data.)



Good Luck

DRW
08-31-2009, 06:26 AM
Thanks vb5prgrmr

I will take a look at cursors. All of my data updates and insert into's are done via SQL and workspace transactions. I am still using DAO, which may be part of the problem.

These SQL transactions appear to have happened on the local cached db and not on the server db, which is disconnected.

I find it stange that the network connection can be lost and the OS reports the problem but my app keeps on running as though nothing has happened. Maybe I should check the network db regularly and stop everything if there is a problem. I am not sure if creating a new database object will fail under these circumstances. It should!

:rolleyes:

vb5prgrmr
08-31-2009, 11:13 PM
A simple query against a known table should fail also. Then there is the possibility of using some Ping code that is flying around to see if your network is up. Either way, a check that returns a boolean should be good enough to notify the user that current network connection is down and they should try later. Then, take their updated information and save it to a file, that way they don't have to reenter the data when the network comes back up.



Good Luck

DRW
09-01-2009, 01:24 AM
I have not tried the query test yet but I can create a database object against a non existent database!

This is really becoming a worry. I am going to try to run an update query while disconnected and see what happens. Is there a way to force the cache to empty?

I have been looking at DBEngine.SetOption dbMaxBufferSize. I will try setting this to zero and see if I can force the 'Disk or Network' error to appear.

:mad:

vb5prgrmr
09-01-2009, 07:02 AM
So you can open a database and/or create a connection/command object to a nonexistant database?

I find that totally bizzare!!!


Good Luck

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum