博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LotusScript_导出数据库路径和名称
阅读量:4604 次
发布时间:2019-06-09

本文共 1640 字,大约阅读时间需要 5 分钟。

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

Sub InitializeConst 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

 

转载于:https://www.cnblogs.com/tianke/p/3490291.html

你可能感兴趣的文章
使用 NPOI 、aspose实现execl模板公式计算
查看>>
行为型模式:中介者模式
查看>>
How to Notify Command to evaluate in mvvmlight
查看>>
33. Search in Rotated Sorted Array
查看>>
461. Hamming Distance
查看>>
Python垃圾回收机制详解
查看>>
jquery 编程的最佳实践
查看>>
MeetMe
查看>>
IP报文格式及各字段意义
查看>>
(转载)rabbitmq与springboot的安装与集成
查看>>
C2. Power Transmission (Hard Edition)(线段相交)
查看>>
STM32F0使用LL库实现SHT70通讯
查看>>
Atitit. Xss 漏洞的原理and应用xss木马
查看>>
MySQL源码 数据结构array
查看>>
(文件过多时)删除目录下全部文件
查看>>
T-SQL函数总结
查看>>
python 序列:列表
查看>>
web移动端
查看>>
pythonchallenge闯关 第13题
查看>>
linux上很方便的上传下载文件工具rz和sz使用介绍
查看>>