zoukankan      html  css  js  c++  java
  • LotusScript_导出数据库路径和名称

    对服务器有些数据库需要建立复本,新建拷贝,修改权限(ACL),或是修改数据库标识符(ID)需要找到这些数据库。这个方法是导出指定服务器上所有数据库的路径,数据库名,标识符等信息,导出后对Excel表格进行筛选,即可对筛选出的数据库进行后续操作。

    Sub Initialize
    Const SourceSever = "xxx.xxx.xxx.xxx"    '源服务器
    Const ExcelSavePath = "C:\ResetReplicaID.xls"
    
    Dim s As New NotesSession
        Dim dbdir As New NotesDbDirectory(SourceSever)
        Dim db As NotesDatabase
        Dim view As NotesView
        Dim doc As NotesDocument
        
        Dim excelApplication As Variant
        Dim excelWorkbook As Variant
        Dim excelSheet As Variant
        Dim i,index1,index2 As Integer
        
        Set excelApplication = CreateObject("Excel.Application")       '创建Excel对象
        excelApplication.Visible = True '显示Excel
        Set excelWorkbook = excelApplication.Workbooks.Add '添加表
        Set excelSheet = excelWorkbook.Worksheets("Sheet1") '选中表
        
        Set db =dbdir.GetFirstDatabase(DATABASE)
        
    '第1行写标题
        excelSheet.Cells(1,1).Value = "DbFile"
        excelSheet.Cells(1,2).Value = "DbTitle"
        excelSheet.Cells(1,3).Value = "DbPath"
        excelSheet.Cells(1,4).Value = "DbName"
        excelSheet.Cells(1,5).Value = "ReplicaID"
        
    '从第2行开始写数据
        i = 2
        While Not(db Is Nothing)
            excelSheet.Cells(i,1).Value = db.FilePath
            excelSheet.Cells(i,2).Value = db.Title
            excelSheet.Cells(i,3).Value =     Left(db.FilePath,Len(db.FilePath)-Len(db.FileName))
            excelSheet.Cells(i,4).Value = Left(db.FileName,Len(db.FileName)-4)
            excelSheet.Cells(i,5).Value = db.ReplicaID
            i = i+1
            Set db = dbdir.GetNextdatabase
        Wend
        
        excelWorkbook.SaveAs(ExcelSavePath)
        excelApplication.Quit
        Set excelApplication = Nothing
        Messagebox("文件已保存")
    End Sub    
  • 相关阅读:
    刷新界面
    分页加载数据(每次10条内容)的简单计算
    Intent传输包含对象的List集合
    android定时更新文件
    java中byte数据转换为c#的byte数据
    java zip文件的解压缩(支持中文文件名)
    Redis PHP扩展安装步骤
    CentOS6.5 开机启动自动运行redis服务
    centos7.2挂载硬盘攻略
    探究:Adobe Premiere Pro CC 2018 导入SRT字幕显示不全问题
  • 原文地址:https://www.cnblogs.com/tianke/p/3490291.html
Copyright © 2011-2022 走看看