>I am accessing remote views via ODBC with a named connection in the VFP database. I thought I would get only one connection handle for the named connection, but it appears each time I open a remote view I get a new connection handle. I vaguely remember seeing something in the documentation about sharing connection handles.
>
>I would appreciate any information you could give me on how connection handles work. Would a shared connection handle greatly slow down data access? What is the most efficient way to open and close multiple data handles? What impact does the multiple connection handles have on the SQL Server database?
>
>
>Thank you,
>Garry
Several ways to get a shared connection for a view:
Under the VFP main menu, Tools, Options. In Remote Data tab, click the Share Connection box. Then click the Set As Default button.
When using the View Designer, you can click on Query on the menu. Click Advanced Options. Then you can Check or UnCheck the Share connection box depending on what you need for that view.
Programmatically:
Create SQL View MyRemoteView remote connection mycon share as select...
Once you open a shared connection view, you get get the connection handle using CursorGetProp. You can then use this handle for SQL pass-thru [SQLExec() function].
Primarily, I use shared, synchronous connection [to Oracle] because my retrievals are usually small and, therefore quite fast. Unshared connections are usually to things like an Access MDB or another VFP Database.
Mark McCasland
Midlothian, TX USA