技术开发 频道

Domino R5用Lotus Script处理XML


    三、 修改VBàLotus Script

    修改后Lotus Script如下 :

    -----------------------------------------------------------------------------

               File:                            DBCONFIG.LSS

                Copyright (c) 2001-2005

                Language : LotusScript

                Description: Global Constants for connect to Oracle DB.

                The PG use a XML file named DBConfig.xml to config DB connections for appliction.

                 Useage :  (1) Declaration : %include "DBconfig.lss"

                                    (2) Code :

                                                 Dim AppName, uid, pwd, tns , index

                                                 index = getDBConfig(appName)

                                                 if  index then

                                                                         AppName = DBConfig(index).AppName

                                                                          uid = DBConfig(index).DB_UID

                                                                         pwd = DBConfig(index).DB_PWD

                                                                         tns = DBConfig(v).DB_TNS

   

                                                                         uid = DB_UID

                                                                         pwd = DB_PWD

                                                                         tns = DB_TNS

                                                           else

                                                                         msgbox (" The appName wasn't found.")

                                                           end if

   

    -----------------------------------------------------------------------------

     Structure for keep xml APPLICATION

    Public Type XMLForDB

    AppName As String

    DB_UID As String

    DB_PWD As String

    DB_TNS As String

    End Type

    Keep xml file content

    Public DBConfig() As XMLForDB

     DB connection

    Public DB_UID As String

    Public DB_PWD As String

    Public DB_TNS As String

    Public DB_Result As Integer

    Const XMLPATH = "D:\Lotus\Domino\DBConfig.xml"

     ///////////////////////////////////////////////////////////////////////////////////////////////////////

     Author   :      ivy8890

     Created  :      2005/04/15

     Purpose  :      Get xml file and parse it and keep all APPLICATION content to DBConfig arrary.

     History  :      <<< ID : 999    Type[Add, Update, Del]  Start   yyyy/mm/dd  Department  Purpose >>>

                         XXXXXXXXXXXXXXXXXXXXXXXXXXXX

                     <<< ID : 999    Type[Add, Update, Del]   End    yyyy/mm/dd  Department>>>

  

    ///////////////////////////////////////////////////////////////////////////////////////////////////////

   

0
相关文章