Chinaunix首页 | 论坛 | 博客
  • 博客访问: 128408
  • 博文数量: 69
  • 博客积分: 595
  • 博客等级: 中士
  • 技术积分: 670
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-16 17:37
文章分类

全部博文(69)

文章存档

2017年(2)

2016年(9)

2015年(13)

2014年(30)

2012年(4)

2011年(2)

2010年(2)

2009年(5)

2008年(2)

我的朋友

分类: SQLServer

2014-11-22 04:18:30

Recently,  migrated all data from Lotus Domino to SQL server. 

Steps:  writing a LotusScript Agent export all data to a csv flat file. As the the large and long time data are complicate, I have to export the data by year to make the errors figured out easily.

%REM
Sub Initialize
Description: Comments for Sub
%END REM
Sub Initialize

Dim fileNum As Integer, I As Integer
Dim fileName As String, eng_url As String
'Dim empLocation As Variant
'Dim empSalary As Currency

Dim ns As New NotesSession 
Dim db As NotesDatabase
Dim docs As NotesDocumentCollection
Dim doc As NotesDocument
Dim view As NotesView

Set db = ns.CurrentDatabase

fileNum% = FreeFile()
fileName$ = "c:\dd\data_b2004.csv"

Open fileName$ For Output As fileNum%

 Set view = db.Getview("All\1999-2004")
    
set doc = view.getFirstDocument

    While Not(doc Is Nothing)
   
    Write #fileNum%, doc.UniversalID, doc.GetItemValue("submitter_name")(0),_
    doc.GetItemValue("submit_date")(0),doc.GetItemValue("time_submitted")(0),_
    doc.GetItemValue("modified_by")(0),doc.GetItemValue("date_modified")(0),_
    doc.GetItemValue("editor")(0),doc.GetItemValue("status")(0),_
    doc.GetItemValue("article_source")(0),doc.GetItemValue("type_of_content")(0),_
    doc.GetItemValue("eng_url")(0),doc.GetItemValue("demo_source")(0),_
    doc.GetItemValue("property_of_content")(0),doc.GetItemValue("Important")(0),_
    doc.GetItemValue("ww_publish_date")(0),doc.GetItemValue("tanslate_comment")(0),_
   doc.GetItemValue("local_format_comment")(0),doc.GetItemValue("on_boulder_server")(0),_
   doc.GetItemValue("primary_zone")(0),doc.GetItemValue("secondary_zones")(0),_
   doc.GetItemValue("recommend_homepage")(0),doc.GetItemValue("published_date")(0),_
   doc.GetItemValue("update_date")(0),doc.GetItemValue("accepted_zone_feature")(0),_
   doc.GetItemValue("feature_image")(0),doc.GetItemValue("boulder_ww_url")(0),_
   doc.GetItemValue("boulder_url")(0),doc.GetItemValue("boulder_code")(0),_
   doc.GetItemValue("file_name")(0),doc.GetItemValue("content_title")(0),_
   doc.GetItemValue("sub_title")(0),doc.GetItemValue("abstract")(0),_
   doc.GetItemValue("content_title_english")(0),doc.GetItemValue("sub_title_english")(0),_
   doc.GetItemValue("abstract_english")(0),doc.GetItemValue("publish_url")(0),_
   doc.GetItemValue("translation_quality_rating")(0),doc.GetItemValue("translation_problems_count")(0),_
   doc.GetItemValue("translation_problems")(0),doc.GetItemValue("eng_source")(0),_
   doc.GetItemValue("e_comments")(0),doc.GetItemValue("is_over_again")(0),_
   doc.GetItemValue("return_date")(0),doc.GetItemValue("after_improve_backdate")(0),_
   doc.GetItemValue("translation_problem")(0),doc.GetItemValue("translation_advice")(0),_
   doc.GetItemValue("content_catalog")(0),doc.GetItemValue("products")(0),_
   doc.GetItemValue("product_version")(0),doc.GetItemValue("author_name")(0),_
   doc.GetItemValue("author_mail")(0),doc.GetItemValue("received_date")(0),_
   doc.GetItemValue("assigned_date")(0),doc.GetItemValue("translation_words")(0),_
   doc.GetItemValue("payment_comments")(0),doc.GetItemValue("date_to_ogilvy")(0),_
   doc.GetItemValue("article_payment")(0),doc.GetItemValue("payment_applied")(0),_
   doc.GetItemValue("paid_date")(0),doc.GetItemValue("acctual_payment")(0),_
   doc.GetItemValue("Contribution_contract")(0),doc.GetItemValue("pay_coments2")(0),_
   doc.GetItemValue("modified_records")(0)
   Set doc = view.GetNextDocument(doc)
  Wend
Close fileNum%

' Read it all back and print it.
'Open fileName$ For Input As fileNum%

'For I% = 1 To 100
'Input #fileNum%, eng_url$
'Print eng_url$
'Next I%

'Close fileNum%


End Sub
阅读(538) | 评论(0) | 转发(0) |
0

上一篇:MSBI Resources

下一篇:SQL Server: Add linked server

给主人留下些什么吧!~~