DAO bug: can't have multiple connections to same database 
Author Message
 DAO bug: can't have multiple connections to same database

I've looked everywhere and can't find any mention of this. If two instances
of an application connect to a database, and the one that connected first
disconnects and exits, the second one crashes when it tries to disconnect
and
exit.

ENVIRONMENT
Win95
VB 4.0 Pro 16-bit
Access 2.0 database
DAO 2.5

SCENARIO
Have a very simple app. It has a single form. In the form load it executes
the
following code:

Set MyWorkspace = DBEngine.Workspaces(0)
Set Global_DB = MyWorkspace.OpenDatabase (DBPath)

In the form unload it has the following code:

Global_DB.Close
Set Global_DB = Nothing

That's it. I make an executable then do the following:

Start the application.
Start a second instance of the application.
Close the first instance of the application (therefore closing the
database)
Close the second instance of the application.

Without fail, I get an invalid operation in OLE32.dll.

Someone suggested closing the workspace object and setting it to nothing.
However, VB won't allow me to set it to delete it from the workspaces
collection
(probably with good reason) so I can't remove all references to the object
and
therefore it will never get freed anyway.

This seems at first glance like you should be able to have two applications
connect
to a database. However, knowing the Jet engine, it's probably impossible...

Any ideas?
Thanks in advance...

-- Jerel McDonald



Tue, 07 Sep 1999 03:00:00 GMT  
 DAO bug: can't have multiple connections to same database

Don't have much experience with Access, but can you try a similar sequence
of actions against another database (SQL Server, dBase, flat file,
anything)? If that too fails the problem is DAO (I guess) but if it works
it's Access/Jet.

Les Schmalzbach.



Tue, 07 Sep 1999 03:00:00 GMT  
 DAO bug: can't have multiple connections to same database

If its any help, I repeated your process using VB 32 and VB 16.  Works fine
under VB 32, but crashes as you said under VB 16.  I guess that points to
the VB 16 DAO object.



Quote:
> Don't have much experience with Access, but can you try a similar
sequence
> of actions against another database (SQL Server, dBase, flat file,
> anything)? If that too fails the problem is DAO (I guess) but if it works
> it's Access/Jet.

> Les Schmalzbach.



Tue, 07 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 'Canned' data in VB program

2. BUG: Multiple threads Cause Connection Busy Error in the Driver

3. Help needed with DAO and Multiple .MDB connections

4. BUG: Multiple threads Cause Connection Busy Error in the Driver

5. I'm having problems querying access database

6. MultiUser Database DAO - 'Addnew'

7. Is Having Multiple Access Databases better than Having one big Access Database?

8. Is Having Multiple Access Databases better than Having one big Access Database?

9. MultiUser Database DAO - 'Addnew'

10. DAO Multiple database 4pt integrated program w/VB

11. Bugs on using multiple access database on VB4 on Windows95

 

 
Powered by phpBB® Forum Software