Показать сообщение отдельно
Старый 23.12.2007, 20:41   #12  
glibs is offline
glibs
Member
Сотрудники компании It Box
Most Valuable Professional
Лучший по профессии 2011
Лучший по профессии 2009
 
4,942 / 911 (40) +++++++
Регистрация: 10.06.2002
Адрес: I am from Kyiv, Ukraine. Now I am in Moscow. For private contacts: glibs@hotmail.com
Вот так сработало. Вроде.

Sub testBatch()
On Error GoTo testBatch_error
Dim axapta As AxaptaCOMConnector.axapta
Dim cac As COMAdminCatalog
Dim axR1 As IAxaptaRecord
Dim axR2 As IAxaptaRecord
Dim res As Object
Dim i As Integer

Set axapta = New AxaptaCOMConnector.axapta
axapta.Logon "glibs", "", "", "AxGleb-30-ru"

Set axR1 = axapta.CreateRecord("CustTable")
Set axR2 = axapta.CreateRecord("CustGroup")
axapta.ExecuteStmt "SELECT * FROM %1 JOIN %2 WHERE %1.CustGroup == %2.CustGroup && %2.CustGroup == 'ХХХ'", axR1, axR2
While axR1.Found
MsgBox CStr(axR1.Field("Name"))
axR1.Next
Wend

Set cac = New COMAdminCatalog
cac.ShutdownApplication ("Navision Axapta Business Connector")

Set cac = Nothing
Set axapta = Nothing

testBatch_exit:
Exit Sub
testBatch_error:
MsgBox Err.Description
GoTo testBatch_exit
End Sub
__________________
С уважением,
glibs®