CDatabase objects in a multi-threaded application

CDatabase objects in a multi-threaded application

Post by Yacov Wolfowic » Wed, 04 Feb 1998 04:00:00



Hi all,

We're writing a multi-threaded application and would like to use One CDatabase
object for many threads. Is it possible?

DB : SQL Server 6.5
Programming Environment : VC 4.2
OS : NT 4.0 ( Hebrew Enabled )

Thanks in advance,
   Yaki

 
 
 

CDatabase objects in a multi-threaded application

Post by Don Grasberg » Thu, 05 Feb 1998 04:00:00


On Tue, 03 Feb 1998 16:58:41 +0200, Yacov Wolfowicz


>Hi all,

>We're writing a multi-threaded application and would like to use One CDatabase
>object for many threads. Is it possible?

>DB : SQL Server 6.5
>Programming Environment : VC 4.2
>OS : NT 4.0 ( Hebrew Enabled )

>Thanks in advance,
>   Yaki

see KB Article ID: Q156138
"How To Use MFC ODBC/DAO, DAO SDK in NT Service or with Threads"

Don Grasberger
(remove --- from address to e-mail)

 
 
 

1. Sharing a single CDatabase object in a multithreaded application

I use VB42+ODBC+MS SQL 6.5. and needs help on multi-threading.

Has anyone encountered this situation? I want to open a database
in a multithreaded application and keep using the same CDatabase
object to access tables in other threads.

              CDatabase db;
              db.Open(...);

Then use db in Thread 1, ..,Thread N to access tables.

I was told this causes database time out problmes, anybody know of
another way? Only other way is to open the database in each thread but
it's very time consuming.

Thank you for your time


Technology Providers, Inc.

2. how to insert record into table of html by ADO

3. Multi-threaded application doing MFC CDatabase->OpenEx()

4. Help Login Screen

5. CDatabase and multi-threading

6. Where are the helpers ?

7. CDatabase Class Multi-thread

8. Question about upgrading from SQL7 to SQL2000

9. Multi-thread capability and non-threaded applications ...

10. VC++ ODBC CDatabase Transactions in Multithreaded application

11. Multi-threaded Pro*C/Pro*C++ applications...

12. Multi-Threaded CLI Application on Linux does not connect

13. Need expert guidance debugging a multi-threaded ODBC/S2K application