Cancel ADO connection to mySQL (from Excel)

griselda

New Member
Joined
Feb 13, 2009
Messages
21
Hi
I will soon have a excel sheet distributed between hundreds of users.
When the excel is first opened, it gets connected to a mySQL database (and stays connected until excel application is closed)

People then do queries, etc using the following code.

' connects to database when workbook is opened (only once)
Set oConn = New ADODB.Connection
oConn.Open connection_string
etc


The following code (part of only) is run to do queries

...
With rsPubs
.ActiveConnection = oConn
.Open sql_Query_String ' sql_Query_String is a SQL query
Range("A10").CopyFromRecordset rsPubs
.Close
End With
...


What I need to know is if, once an user has stopped searching/querying the database, should I use
oConn.Close
(and connect again "when needed") or is it better to leave the connection opened at all times while Excel application is running?
Users normally will have the excel opened for a period of 30-60 minutes, although they will not be querying the mySQL database continuously.

I have done some testings but only with 5 users at once. Everything runs perfect however I am concerned once there are +50 users connected, I will start having performance/connection problems.

Has anyone had any experience with this type of set up ?

thanks for your comments
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,216,153
Messages
6,129,176
Members
449,491
Latest member
maxim_sivakon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top