Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handles for SQL Server 1

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
0
0
GB

Hi all

My VFP 8 application has lots of classes that fetch data back from a SQL Server using pass-through.

Now my question is, should these classes use one global handle variable to SQL Server or have their own and discard them when no longer needed (so inbuilt in the class).

Whats the best approach? Will loads of handles flying around slow everything down or does it not matter if they are used then discarded?

The classes in question are simple ones using combos, etc. Nothing complex.


Thanks
ITflash
 
If it is a local app, I think you should use and discard. You don't want to leave a handle active when not in use due to licensing issues on SQL Server.

PF
 

thanks for the reply

licensing not a problem - processor license.

was worried about slowness if lots of handles being used and discarded rather than just one.

 
Itflash,

I have to disagree with PerryF. I believe it is much more efficient to get a connection handle when you do your first call to the server, and to retain and re-use that same handle throughout the app.

There is a significant overhead in creating the connection. If you get a new handle each time, it will slow down your app. This is not a licensing issue. It is purely a matter of performance.

I have written a class which simplifies the handling of the connection handle, and provides a few other house-keeping features as well. You are welcome to have a copy. You can grab it from
Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 


Thanks for your thoughts.

I'll relook at my application (Its for about 20 users) Think there is quite a few handles flying around.

I'll take a look at your prg, which deserves a vote.

Cheers
ITflash
[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top