Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

R5 - @dblookup to utilize both a server and a local db

Status
Not open for further replies.

JoseQuiervo

Programmer
Sep 25, 2002
57
US
Using a formula, how can I check to see if the database is local or on the server automatically using a @dblookup? My main db is TestDb.nsf and it is pulling names from TestDbNames.nsf using @dblookup on dialog field name Name. I'm trying to use an @If and checking to see if the db is local or on the server then to show what I'm looking for. Right now, I can only get it to work one way or the other but never both. In the notes help on specifying the server and database, it only gives examples of one or the other but never both. If this makes any sense, could you please help? Thank you!!!!
 
It makes sense : you are trying to do something that cannot be done.
The formula can very determine if the db is local or on a server. Just use
Code:
ServerName:=@Subset(@DbName;-1)
and you will get the name of the server if the db is on a server, or an empty string if the db is local.
What you must understand is that if the db is on a server, there is no way that the formula can look up anything on local.
The only way to do so is to forego the server name and hard-code the empty string in the @DbLookup formula, and that will only work if it is the client that is executing the code.

Remember that the server cannot look up anything on the client. Only the client can do so. Which means that you cannot do this in scheduled agents.

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top