need help,question of connections of ADO

need help,question of connections of ADO

Post by Joshu » Fri, 29 Jun 2001 15:00:10



I am writing a program which will have some workthreads visiting a database
source simultaneously.
My Questions is:
1.is it a proper idea if I establish a single connection then every
workthread share it? 2.in this case, should i treat the connection as a
critical resource?
3.if the connection be closed out of the program,for example , administrator
shut down the database.how can i detect it?
4.is it efficient if I establish a new connection in every visiting to
database(close it when finish)?

thanks a lot!

sincerely,
Joshua

 
 
 

1. Need help with connection string ADO

I am using the following code to hard code my database info.

strConnection = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=C:
\VB\MyApp\MyDB.mdb"
cn.Open strConnection

My problem is that I can not type this way:

 strConnection = "Provider=Microsoft.Jet.OLEDB.3.51;Data
Source=gs_mdbname"

gs_mdbname = " c:\vb\myapp\mymdb.mdb"

The application I am working on will be used on several workstatations
and I can not hardcode the db directory?

I am looking for some advise.

thanks

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Transfering a Cube Structure

3. Need help with ADO connection

4. kill command

5. ADO Connection Gets Dropped - Help Needed

6. URGENT - Error connecting to database after program is packaged and deployed

7. Need help with ADO Connection of a distributable application

8. WinFaxPro

9. Need help with ADO/ODBC connection

10. Access Database, ADO-ODBC, Connection string help needed ...

11. ADO Question - Please help - How To Keep one connection open

12. Need to read sql2k table thru ado, need connection statement

13. Connection pooling question, need help!