Код: Виділити все
x=msgbox("VB Start" ,0, "Message")
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("test.txt", True)
tf.WriteLine("Тестирование 1, 2, 3.")
On Error Resume Next
set App = CreateObject("Medoc.ZApplication")
'Cnd = "CharCode = 'J1201007' AND PerDate >= '26.07.2013' and PerDate < '01.11.2014' and SENDSTT = 14"
Cnd = "CharCode = 'J1201007'"
DocCode = 0
cnt=0
x=msgbox(cnd ,0, "Message")
Set rsDocs = App.DocumentsDataSet(Cnd) 'массив документов
rsDocs.First
While Not rsDocs.EOF
cnt = cnt + 1
DocCode = rsDocs.FldVal("Code")'уникальный код документа
if DocCode > 0 then
Set SomeDoc = App.OpenDocumentByCode(DocCode)'открываем документ по коду
Set oMain = SomeDoc.DataSets()
Set nValue = oMain.FldVal("FIRM_NAME")
'str = SomeDoc.GblVal("N3") 'получение значение из документа
tf.WriteLine("1= " + cstr(value))
Set nValue = oMain.Fields.Item("FIRM_NAME").Value
tf.WriteLine("2= " + cstr(nvalue))
Set nValue = SomeDoc.FldVal("FIRM_NAME")
tf.WriteLine("3= " + cstr(nvalue))
end if
rsDocs.next
Wend
x=msgbox("VB End: " + cstr(cnt) ,0, "Message")
tf.Close
но в итоге всегда получаю пустое значение, в чем может быть проблема?