Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing Connection from TWO DBC
Message
From
01/04/2010 21:15:43
 
 
To
01/04/2010 15:46:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows NT
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01458440
Message ID:
01458463
Views:
45
>We are using an old MS SQL database (ver. 6.5) that is sensitive to resource taken up by "connections." Recently, I created a VFP9 application that contains two different DBC's. One DBC contains queries that are unique to the application and the other DBC contains queries that are general to many applications. Although I have each query set to "Share" in both DBC's, I just noticed that each DBC requires a connection to the SQL server. Is there anyway to get two DBC's to share the same connection? Also, I just noticed that the "name" of the connection in the two DBC's are slightly different. Would it make any difference if I renamed them the same name or is this an issue because each DBC establishes its own connection.
>
>I realize I can copy the queries from one DBC into the other DBC and then I would have all queries in just one DBC and thus get down to just one "shared connection." But, that would defeat the reason they were separted into two DBC's in the first place which was to keep a master DBC of common queries for multiple applications.

At the lowest level, it may be worth checking that both SQL Server 6.5 and the database driver you're using support shared connections.

It sounds like you are storing connection information in DBCs. Instead, you could manage connections programmatically yourself which would give you full control over establishing, sharing and using connection handles.

Another possibility would be to create a third DBC on the fly, from the other two, that contains all of their information.

The GenDBC tool could be useful for either merging two DBCs or getting code that you can tweak programmatically.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform