In VBA check for ODBC or Network Connection

L

Lee T.

I have a user that wishes to use a database on a laptop in
the field. They need an update button to import data from
the ISeries (AS/400). I would like the update to not run
(as in hide or disable the button for importing data) if
1. The ODBC connection is not on the machine
******** OR ********
2. The PC is not on the network (look for a file on a
network drive or if the drive exists)

How can I do this in VBA code?

TIA

Lee T.
 
T

TC

Maybe in the startup code for the database, you could do something that
would fail with an error if the onnection was not present of the PC was not
on the network? Pehaps query a remote table for the TOP 1 records? Use error
trapping (on error resume next) to suppress the normal message. Enable or
disable the import button, depending on whether that quick check did or did
not get an error. Or, set a global variable with the result (true=ok,
false=not ok) so the form can enable/disable the button later, when
appropriate.

HTH,
TC
 
J

jack chen

-----Original Message-----
I have a user that wishes to use a database on a laptop in
the field. They need an update button to import data from
the ISeries (AS/400). I would like the update to not run
(as in hide or disable the button for importing data) if
1. The ODBC connection is not on the machine
******** OR ********
2. The PC is not on the network (look for a file on a
network drive or if the drive exists)

How can I do this in VBA code?

TIA

Lee T.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top