Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: ChengTing Tsai
  Where is ChengTing Tsai?
 Kaohsiung
 Taiwan
 ChengTing Tsai
 To: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 Tags
Subject: RE: Connection
Thread ID: 228313 Message ID: 228480 # Views: 4 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, May 19, 2009 10:05:02 AM         
   


> That is partly correct. You can reuse it only if you have not closed it.
>
> The CA accepts 3 ways to connect:
>
> 1. Connection Handle -
> oConn = SQLSTRINGCONNECT(SQLCONNECTIONSTRING)
>
> Then you can refer to this handle - oConn and use it till you close it. If you close it then you have to create a new connection handle before using it.
>
> 2, DSN - This is setup on the local computer
>
> 3. Connection Strin
>
> For 2 & 3 above I am sure the CA opens and closes it as needed. If you set up the Form to use the connection property of the DE and you specify 2 or 3 (as above) then the connection will be handled by the DE. If you close the form, the connection will be automatically closed.
>
> If you close an open connection manually you cannot use CursorSetProp to recover it. You have to manually open a new connection.
>
> This is what I do:
>
> I use method 1 above - oConn stores my handle and the connection is left open for the complete time the application session is open.
>
> I also use a VFP command
>
>
SQLSetprop(oConn,"IdleTimeout",0) 

>
> Look it up in the help. It closes idle connections and opens them as needed.
>
> Bottom line is if you use method 1 then you have to create and close the connection.
>
> If you use method 2 & 3 above then the CA or DE will manage the connection open/close.

To Bernard~~
Thanks for your help and sharing experience with me.
Your support make me resolve my question about the connection manager in CA. Thanks again ^_^

ENTIRE THREAD

Connection Posted by ChengTing Tsai @ 5/18/2009 9:38:45 AM
RE: Connection Posted by Anders Altberg @ 5/18/2009 9:48:15 AM
RE: Connection Posted by ChengTing Tsai @ 5/19/2009 1:34:16 AM
RE: Connection Posted by Bernard Bout @ 5/19/2009 6:09:01 AM
RE: Connection Posted by ChengTing Tsai @ 5/19/2009 10:05:02 AM