Link to home
Start Free TrialLog in
Avatar of gbentley
gbentley

asked on

Detecting Database

I have a Notes db which accesses corporate data via an ODBC connnection. The problem is that if the person is not on the network, the lookup fails and Notes shuts down.

Is there some way to detect whether the database is accessible without crashing Notes? My thought is to use this test to hide the New button so the user can't create new documents when offline. I've already got it to work happily with existing documents by saving the data and not doing the lookups on existing docs.

Thanks
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Instead of having every client to set up his own ODBC connection, you could use DECS and make the connection from the server's database to the corporate data. No server available -> no corporate data but without the errors. Or has every user a local copy of your application and uses it, even when connected to the server? Just for the background: what Notes/Domino versions do you use?
Avatar of gbentley
gbentley

ASKER

Some users will certainly have local replicas and will often be offline. We also have the problem that there are 35 offices where there is no local Notes server, but the corporate data for that office resides on that offices network server. The users access a Domino server remotely for mail and some other dbs, but this one has to look at the ODBC connection on the users PC which maps to the local database they need to use.

And, I'm afraid buying 35 Notes servers is not an acceptable solution!

Thanks
You can check that by using @Subset(@DBNAME;1)

This will return server name if the db accessed is on server and "" if it is local. Use this to hide the button

~Hemanth
If I understand you correct, you are saying that if the ODBC data source is available, then all is well and good, but if the ODBC source is not available, Notes crahses when it tries to access ODBC.

This should not happen in the first place.  You should recieve a detecable ODBC driver failuree message, not a client crash.  How are you accesisng ODBC?  @DBxxx?  LS:DO (use "*odbc")?  Lotus Connectors (use "*lclsx")?  ADO?
Herman - The Notes db may be on the users C: drive whether or not they are in the office.

qwaletee - I'm accessing it using DBLookups and @DBColumns. The usage is to populate a pair of list boxes to allow the users to select a Client. I've tried calling @Dblookup putting the result in a variable and testing that with @IsError, but it still dies horribly.

Is there a way to populate a Listbox/Combo/DialogList using an Agent? That would solve my problem.

Thanks for the suggestions so far.
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Don't use @DbLookup agains ODBC.  Instead, use LotusScript with LCLSX (or even LS:DO), which is more robust.
qwaltee,

How exactly do I use that method to populate a ComboBox?

Herman - I like that approach, I'll try coding it up and get back to you all.

Thanks
Thanks. The startup routine works fine.