369 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Forum | Blogs | Search | myPL | About 
 
May 22, 2012, 02:57:47 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Script for starting up databases  (Read 902 times)
0 Members and 1 Guest are viewing this topic.
aprochaska
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: June 08, 2009, 01:25:35 PM »

This is probably a very-newbie question for this forum, but here goes....

When I start up Notes there are 4-5 databases that I typically start up before I begin work, but those databases vary depending on whether I'm in the Office (LAN-connected) or Home (DSL) configuration.  Is there a way to create scripts to run the databases for each scenario, and then I could just run one script to start up everything I need?

Thanks for help.

Currently running Notes 6.5.5 client on XP.  I don't have access to the servers.
Logged
tobimagwire
Newbie
*
Offline Offline

Posts: 6



View Profile WWW
« Reply #1 on: November 25, 2010, 08:26:04 PM »

You can do that

Try this code, it checks for list of location first, then let the user select from the list, once you have the selected location then you can check it and do your open database code

Sub Initialize
   Dim workspace As New NotesUIWorkspace
   Dim locationString() As Variant
   Dim locCounter As Integer
   Dim response As Variant
'-----------   
   
   Dim localnames As NotesDatabase
   Dim doc As NotesDocument
   Set localnames =  New NotesDataBase( "" , "names.nsf")
   Set locview = localnames.GetView( "Locations" )
   
   Set doc = locview.getfirstdocument
   
   While Not (doc Is Nothing)
      Redim Preserve locationString(locCounter)   
      locationString(locCounter)   = doc.Name(0)
      locCounter = locCounter + 1
      Set doc = locview.getnextdocument(doc)      
   Wend
   
   response = workspace.Prompt (PROMPT_OKCANCELCOMBO, _
   "Select a Location", _
   "Select a location to work.", _
   locationString(0), locationString)
   If Isempty (response) Then
      Call workspace.SetCurrentLocation(locationString(0))
   Else
      Call workspace.SetCurrentLocation(response)
   End If
   
   
'-----------   
   If response = "Location To Check" Then
      'call your database here
   End If
   
   
   
   
End Sub
Logged

GSL
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!