vfp9 sp1

I need to test for the availablility of an ODBC connection. I have
been doing this simply by opening the database and TRYing to USE one
of the views. This has worked fine on the two workstations I have
(remote) access to, one connected and one not.

I am being told, however, that this test often hangs on unconnected
workstations.

Is there a way to impose a timeout on a USE command? Or perhaps there
is a more direct way to test for the ODBC connection?

Thanks

Re: Test ODBC connection by Dan

Dan
Tue Apr 22 11:08:04 CDT 2008

You might be able to use IdleTimeout or QueryTimeout. See dbSetProp().

Dan

George Smith wrote:
> vfp9 sp1
>
> I need to test for the availablility of an ODBC connection. I have
> been doing this simply by opening the database and TRYing to USE one
> of the views. This has worked fine on the two workstations I have
> (remote) access to, one connected and one not.
>
> I am being told, however, that this test often hangs on unconnected
> workstations.
>
> Is there a way to impose a timeout on a USE command? Or perhaps there
> is a more direct way to test for the ODBC connection?
>
> Thanks



Re: Test ODBC connection by George

George
Tue Apr 22 13:54:42 CDT 2008

Thansk for the tip. I browsed the docs and settled on the connection
timeout. I'm not exactly sure I used it correctly, but it doesn't
hurt my two test machines. I'm sure I hear about the other production
areas!

On Apr 22, 9:08=A0am, "Dan Freeman" <s...@microsoft.com> wrote:
> You might be able to use IdleTimeout or QueryTimeout. See dbSetProp().
>
> Dan

Re: Test ODBC connection by George

George
Wed Apr 23 16:44:40 CDT 2008

I seem to have a problem with the above mentioned DBSETPROP. Here is
how I added the call:


OPEN DATABASE (odbc_path+'lms_logger')
* added next - 4 seconds is arbitrary
=DBSETPROP('lmslogger',"CONNECTION","ConnectTimeout",4)
TRY
USE header_view IN 0 ALIAS test NODATA
rtn=.T.
CATCH
rtn=.F.
ENDTRY

Although this works just fine on my development machines, (both XP
Sp2) the one production machine (W2000 SP4) that actually does have
the ODBC connection now fails - it times out!

Does this make any sense to anyone?

Thanks