Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Tips and tricks in LotusScript (continued)

Dim recdateV As Variant
y = Mid(text,i,4)
m = Mid(text,6,2)
d = Mid(text,8,2)
recdateV = Datenumber(y,m,d)

This will work every time because DateNumber has three parameters where you specifically state the month and day separately. Thus, it's unconnected with the machine's current date format settings. Once you have the value in a variant, you use it to set the LSLocalTime of the NotesDateTime:


recdate.LSLocalTime = recdateV

This works because the LSLocalTime value is a variant as created by DateNumber. The time part of LSLocalTime matches the TimeNumber value, so you can actually create the whole NotesDateTime value as follows:

Dim recdate As New NotesDateTime(today) 'don't care at this point what the date value is...
Dim recdateV As Variant
Dim rectimeV As Variant
'assuming text contains a string, formatted: 2003-01-02 12:30:54
y = Mid(text,1,4)
m = Mid(text,6,2)
d = Mid(text,9,2)
h = Mid(text,12,2)
n = Mid(text,15,2)
s = Mid(text,18,2)
recdateV = Datenumber(y,m,d) 'value to left of decimal point
rectimeV = Timenumber(h,n,s) 'value to right of decimal point
recdate.LSLocalTime = recdateV + rectimeV

Running agents on the server
One thing I didn't have to worry about on the mainframe was where code executed. It always happened on the mainframe, and the mainframe terminal was dumb, even dumber than early Web browsers. But in the client/server architecture of Notes, things are a little different, particularly when it comes to agent code. By and large, it's possible to say that in Notes, if the user action starts something off, it happens on the client, and if the server starts it, it happens on the server.

That's all very well, until you start to need back-end connectivity from your Notes application. You may want to be able to connect to the backend from the Notes client but don't want the hassle and cost of backend connectivity connection being installed on every computer. This is where NotesAgent.RunOnServer comes in.

One application I did recently for a customer was to look up information about end-users' computers in a DB2 database, using user identification details from the Domino address book. Use the DB2 LSX, I thought, easy. Hazily remembering how I'd used DB2 in the past, I wrote an agent that would format the SQL, execute it, get results, and create Notes documents. But I don't have a DB2 client enabled on my laptop, and even if I had one, and I don't, it isn't the final execution environment. That is a Domino server, which already has a DB2 client enabler. But then to test my application, I have to run the agent on the server.

First thoughts would be to use a scheduled agent, but that's a real pain to keep rescheduling it as you create and test it. Another one is to install a client on the server and run the agent there. Then I could also use the script debugger to get the agent working. If the server is physically accessible and runs NT or Win2K where you can install a client, that's fine, but it might be an AIX server. Actually it was an NT4 server, and I did do my early testing with a client on the server, but that spoils the story.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


Learn more at www.integra4notes.com.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login