Empty string parameter returns db file path and name

I have a scheduled agent using the following code:

Dim variableName As New NotesDatabase( “”, mydb.nsf )

This worked but after moving to a new server it returns the following error:

Cannot open database on machines other than the server running your program (myfolder\mydb.nsf!!myfolder\mydb.nsf).

That is not what the error is supposed to be. It should be:

Cannot open database on machines other than the server running your program (!!<path\databasename>)

I have no idea why its pulling <path\databasename> on both sides like that. It’s as though the empty string is being evaluated to the path\databasename rather than being evaluated to local server. Anybody ever see anything like this before?

Subject: Empty string parameter returns db file path and name

Very strange indeed.

I wonder if this happens for all db’s or just this one db ? Do the server and/or db name come from a configuration document or are they hard coded into the agent ?

Just a note that the mydb.nsf should be in quotes (“mydb.nsf”) but I’m sure that you already have this in the actual code.

Here are some things to try:

  1. Check for directory names that match the database name or any other weird dir names on the server.

  2. Try editing and saving the agent on the new sever. If this makes no difference then I would write some code to dump out a listing of all files on the current directory

  3. Run a scheduled agent on the server with code something like the following:

Dim dbdir As New NotesDbDirectory(“”)
Dim db As NotesDatabase
Set db = dbdir.GetFirstDatabase(DATABASE)
While Not(db Is Nothing)
Print db.Title, , db.FileName
Set db = dbdir.GetNextDatabase
Wend

This may give you a clue as to what is happening.

Good luck.

Ethann Castell

Caliton Innovations

web: http://www.caliton.com | blog: http://www.ethann.com

Subject: Empty string parameter returns db file path and name

Hi Gary,

“” does not represent local server. It represents local client. Why don’t you get a handle on the server. IE serv = currentdb.server and then use that variable to set your db.

Are you trying to access a local database?

HTH,

Mark

Subject: RE: Empty string parameter returns db file path and name

Thanks Mark.

I have tried the suggestions you make and it does solve my problem, however … all the Lotus documentation tells us to use the empty string ( “” ) when referencing local databases. Consequently, I have tons of applications/code with this format used for creating a handle to a local database. I would very much like it to work as advertised rather than embarking on the long and painful process of re-coding all those applications.

This does not happen on all my servers either, just a few dozen out in production. This is just one example of the issue I’m dealing with. Basically any script that uses an empty string parameter has this issue so I would have to re-code a ton of stuff.