Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: prasanna kunder
  Where is prasanna kunder?
 mumbai
 India
 prasanna kunder
 Tags
Subject: RE: how to check connection is live or not
Thread ID: 373647 Message ID: 373650 # Views: 87 # Ratings: 1
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Sunday, March 24, 2013 7:34:47 PM         
   


> Hello Expert
>
> after making connection
> like this
> gnSqlConnection = SQLStringConnect("DRIVER={MySQL ODBC 5.2(w) Driver};SERVER=192.168.0.52;database=maxell_Data;uid=root;pwd=pmk007")
>
> if disconnect from lan
>
> for every .DataSource
>
> how to check whether connection is live or not
> before attaching to .DataSource
>
> thanks in advance

You run your usual functions. If the the function's return value indicates a failure, you check, with AERROR(), if the failure report says 'no connection'.

A test to check if the connection is valid is meaningless because in the next thousandth part of a second it may no longer be valid.
-Anders

ENTIRE THREAD

how to check connection is live or not Posted by prasanna kunder @ 3/24/2013 7:02:59 PM
RE: how to check connection is live or not Posted by Anders Altberg @ 3/24/2013 7:34:47 PM