K
Познакомьтесь с пентестом веб-приложений на практике в нашем новом бесплатном курсе
<div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">Примерчик</div></div><div class="sp-body"><div class="sp-content"><!--shcode--><pre><code class='ls'>Option Publicда, в принципе все равно, что юзать, главное данные вытащить
а с LSX ранее не сталкивалась
Dim ses As New NotesSession
Dim db As NotesDatabase
Dim connection As New LCConnection("oracle")
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim LCRecord As New LCFieldList
Dim fCustomerid As LCField, fCustomername As LCField, fCustomercode As LCField, fCustomertype As LCField
Set db = ses.CurrentDatabase
Set dc = db.Search({Form = "Customer"}, Nothing, 0)
If dc.Count > 0 Then
connection.Server = "ORACLE"
connection.Userid = "User"
connection.Password = "qwerty"
connection.Metadata = "zoo.ln_legalcompanies"
On Error Goto Trap
connection.Connect
Msgbox "Successfully connected to B2Oracle."
Set doc = dc.GetFirstDocument
While Not (doc Is Nothing)
Set LCRecord = New LCFieldList
Set fCustomerid = LCRecord.Append(doc.GetItemValue("customerid")(0), LCTYPE_TEXT)
Set fCustomername= LCRecord.Append(doc.GetItemValue("customername")(0), LCTYPE_TEXT)
Set fCustomercode = LCRecord.Append(doc.GetItemValue("customercode")(0), LCTYPE_TEXT)
Set fCustomertype = LCRecord.Append(doc.GetItemValue("customertype")(0), LCTYPE_TEXT)
Call Connection.Insert(LCRecord)
Set doc = dc.GetNextDocument(doc)
Wend
Trap:
Msgbox "Connection failed with error " & Err & ": " & Error
Exit Sub
End If
connection.Metadata = "zoo.ln_legaldocuments"
On Error Goto Trap
connection.Connect
Msgbox "Successfully connected to B2Oracle."
Set doc = dc.GetFirstDocument
While Not (doc Is Nothing)
Set dcres = doc.Responses
If dcres.Count>0 Then
Set docres = dcres.GetFirstDocument
Set LCRecordres = New LCFieldList
Set fIDres = LCRecordres.Append("ID", LCTYPE_TEXT)
Set fDocno = LCRecordres.Append("DOCNO", LCTYPE_NUMERIC)
Set fDocname = LCRecordres.Append("DOCNAME", LCTYPE_TEXT)
Set fDocstatus = LCRecordres.Append("DOCSTATUS", LCTYPE_TEXT)
Set fDocver = LCRecordres.Append("DOCVER", LCTYPE_NUMERIC)
Set fParentref = LCRecordres.Append("PARENTREF", LCTYPE_TEXT)
Set fBocomment = LCRecordres.Append("BOCOMMENT", LCTYPE_TEXT)
Set fModified = LCRecordres.Append("MODIFIED", LCTYPE_DATETIME)
Set fNotesunidres = LCRecordres.Append("NOTESUNID", LCTYPE_TEXT)
While Not docres Is Nothing
If docres.form(0) = "document" Then
fIDres.Value = r
fDocno.Value = Implode(Split(docres.GetItemValue("DocNo")(0),"."),",")
fDocname.Value = docres.GetItemValue("DocName")(0)
fDocstatus.Value = docres.GetItemValue("DocStatus")(0)
fDocver.Value = docres.GetItemValue("DocVer")(0)
fParentref.Value = docres.GetItemValue("ParentRef")(0)
fBocomment.Value = docres.GetItemValue("BOComment")(0)
fModified.Value = docres.GetItemValue("DocModified")(0)
LCRecordres.Notesunid = docres.UniversalID
Call connection.Insert(LCRecordres)
r = r+1
End If
Set docres = dcres.GetNextDocument(docres)
Wend
End If
Set doc = dc.GetNextDocument(doc)
n = n+1
Wend
Trap:
Print "Connection failed with error " & Err & ": " & Error
Msgbox "Connection failed with error " & Err & ": " & Error & Chr(13) & Chr(10) & connection.Metadata
Exit Sub
End If
Set fCustomerid = LCRecord.Append("customerid", LCTYPE_INT)
Set fCustomername= LCRecord.Append("customername", LCTYPE_TEXT)
fCustomerid.Value = doc.GetItemValue("customerid")(0)
fCustomername.Value = doc.GetItemValue("customername")(0)
Set fCustomerid = LCRecord.Append("customerid", LCTYPE_INT)
Set fCustomername= LCRecord.Append("customername", LCTYPE_TEXT)
fCustomername.Value = doc.GetItemValue("customername")(0)
fCustomerid.Value = doc.GetItemValue("customerid")(0)
Dim connection As New LCConnection("oracle")
connection.Server = "B2ORACLE.WORLD"
connection.Userid = "READ"
connection.Password = "111"
connection.Metadata = "UA_PERSONS"
On Error Goto Trap
connection.Connect
Dim keys As New LCFieldList
Dim field As LCField
Dim fields As New LCFieldList
Dim empno As LCField
Dim lastname As LCField
Dim hiredate As LCField
Set field = keys.Append ("CLOCKNO", LCTYPE_TEXT)
' field.Flags = LCFIELDF_KEY
field.Flags = LCFIELDF_KEY_NE
field.Text = pDoc.GetItemValue("TabelNo")(0)
If (connection.Select (keys, 1, fields) = 0) Then
' If (connection.Select (Nothing, 1, fields) = 0) Then
Print "нема даних"
Msgbox "нема даних"
End
End If
Set lastname=fields.lookup("LASTNAME")
Set empno=fields.lookup("OTP_BEG")
Set hiredate=fields.lookup("OTP_END")
msg1=""
While (connection.fetch(fields)>0)
msg1=msg1 & "LASTNAME= " & lastname.text(0) & " EMPNO= " & empno.text(0) _
& " HIREDATE= " & hiredate.text(0) & Chr(10)
Wend
Messagebox msg1
While (connection.fetch(fields)>0)
msg1=msg1 & "LASTNAME= " & lastname.text(0) & " EMPNO= " & empno.text(0) _
& " HIREDATE= " & hiredate.text(0) & Chr(10)
Wend
Да, но строгий порядок необязателен - я об этом дал ссылку выше.возвращаюсь к своим граблям, с прошлим проблемом разобрался....
ошибка била в том что данние надобно записивать в строгом порядке...
См. там же.но fields пустой..... в чем может бить проблем.....????
но вот если дальше ити и смотреть на
While (connection.fetch(fields)>0)
видаст все записи из таблици....
If connection.Fetch(fields) > 0 Then
'Код работы с "рекордом"
End If
Обучение наступательной кибербезопасности в игровой форме. Начать игру!