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) |