Lotus script 打开现有文件向胡据库导入数据
2011-07-15 09:29
183 查看
参考
Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim ss As New notessession
Dim db As notesdatabase
Dim item As notesitem
Dim files As Variant
Dim schar As String
Dim doc As NotesDocument
Dim cpdoc As NotesDocument
Dim excelapplication
Dim i,sheet
Set db = ss.currentdatabase
files = ws.openfiledialog(False, "请选择要导入的Excel文件 ", "Excel file/*.xls ")
If Not(Isempty(files)) Then
Set excelapplication = createobject( "excel.application ")
Set excelworkbook = excelapplication.workbooks.open(files)
Set excelsheet = excelworkbook.worksheets(1)
i = 2
Do Until Cstr(excelsheet.cells(i,1).value) = " "
Set cpdoc = New notesdocument(db)
cpdoc.NumberID = excelsheet.cells(i,1).value
cpdoc.company = excelsheet.cells(i,2).value
i = i+1
Loop
excelworkbook.close(False)
excelapplication.quit
Set excelapplication = Nothing
End If
End Sub
Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim ss As New notessession
Dim db As notesdatabase
Dim item As notesitem
Dim files As Variant
Dim schar As String
Dim doc As NotesDocument
Dim cpdoc As NotesDocument
Dim excelapplication
Dim i,sheet
Set db = ss.currentdatabase
files = ws.openfiledialog(False, "请选择要导入的Excel文件 ", "Excel file/*.xls ")
If Not(Isempty(files)) Then
Set excelapplication = createobject( "excel.application ")
Set excelworkbook = excelapplication.workbooks.open(files)
Set excelsheet = excelworkbook.worksheets(1)
i = 2
Do Until Cstr(excelsheet.cells(i,1).value) = " "
Set cpdoc = New notesdocument(db)
cpdoc.NumberID = excelsheet.cells(i,1).value
cpdoc.company = excelsheet.cells(i,2).value
i = i+1
Loop
excelworkbook.close(False)
excelapplication.quit
Set excelapplication = Nothing
End If
End Sub
相关文章推荐
- 打开或导入项目,从脱机 Outlook 数据文件 (.ost)
- [求助] 导入多个未打开的Excel文件数据的问题
- MVC模式导入数据并打开.xls文件实现
- Excel文件无法导入,错误: 它已经被别的用户以独占方式打开,或没有查看数据的权限。
- 打开或导入项目,从脱机 Outlook 数据文件 (.ost)
- sql server 去掉导入csv文件时数据上的引号
- 存储过程中执行bcp命令将数据导入 并在其他文件服务器上生成log文件
- 如何将excel文件中的数百万条数据在1分钟内导入数据库?
- php数据导入导出之excel(csv文件)
- mysql从csv文件导入数据时提示int类型出现' '(空字符串)
- 数据文件导入mysql时出现中文乱码问题
- Microsoft Jet 数据库引擎打不开文件'(未知的)'。 它已经被别的用户以独占方式打开,或没有查看数据的权限
- 两个可将Excel文件数据导入到数据库中的开源项目
- java中excel文件数据的导入
- 用函数fopen_s打开数据文件
- mysql source导入多个文件/较大的sql文件/在线互转数据
- mysql导入数据load data infile用法(将txt文件中的数据导入表中)
- java多线程,将oracle中数据导入到sql到文件(包括大字段转换成字符串)
- 如何利用powerbulder 9.0打开sybase sql anywhere 6.0的数据文件
- 将数据从CSV文件导入PG数据库