Date:  04/20/2010 03:23:07 PM Msg ID:  004165
From:  FoxWeb Support Thread:  004164
Subject:  Re: open connections to MS-SQL server
Your question is not specific to FoxWeb, so you will probably get more responses if you post it in a forum that is frequented by the general VFP community. Try Microsoft's VFP forum, or The Universal Thread. 
FoxWeb Support Team email
Sent by Randy Byers on 04/20/2010 03:16:51 PM:
All of our foxweb scripts use a back-end MS-SQL database for data storage.
Typical usage looks like this:
m_handle = SQLCONNECT(t_db,t_u,t_pw)
m_query = 'select field-list from tablename' 
select cursor10
** do stuff with data in cursor 
We have a busy environment with many users and hundreds of different scripts (and multiple foxweb servers).  
Our issue is that over time, we see a gradual growth in the number of "open" connections to the MS-SQL server from our foxweb server(s).  The majority of these connections are in a "sleeping" state (according to MS-SQL).
The Foxweb option named "Close Tables" is enabled. 
The issue is that once the number of "open/sleeping" connections to MS-SQL increases to 200 or more, we start to have stability issues with our Foxweb server(s).
I'm wondering if there are other Foxpro commands I can run in an attempt to "clean up" open/stale/sleeping connections which are left over by my scripts.
For example, can I safely call "close databases [all]" ?
Can I safely call "close tables [all]" ?
Do you know if there is anything else I can do to close/kill connections to the MS-SQL server from within Foxpro?