j_hass
19th March 2010, 13:44
Dear BAAN-Friends,
we're going to migrate from Vc to LN 6.1.
The following SQL, which I have integrated in Excel, works fine on Vc but doesn't work on LN:
:
Query = "select tfcmg101.*, tfacp200.* from tfcmg101, tfacp200 where tfcmg101.btno between " & lnr & " and " & lnb & " and tfacp200._compnr = tfcmg101.comp and tfcmg101.ttyp = tfacp200.ttyp and tfcmg101.ninv = tfacp200.ninv and tfacp200.docn = 0 "
B_function = "olesql_parse(" & Chr(34) & Query & Chr(34) & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
query_id = Val(BaanObj.ReturnValue)
If query_id = 0 Then
MsgBox "function olesql_parse fails"
GoTo BaanAutomationError
End If
:
Table tfcmg101 is located in company 100, tfacp200 is in various companies > 100.
On LN I always receive zero as a query_id. I suppose the situation depends on the "_compnr"-join, because when I type a static company number instead of "_compnr", it works (but with unreasonable results).
Who can help or explain?
Thx a lot.
Juergen
we're going to migrate from Vc to LN 6.1.
The following SQL, which I have integrated in Excel, works fine on Vc but doesn't work on LN:
:
Query = "select tfcmg101.*, tfacp200.* from tfcmg101, tfacp200 where tfcmg101.btno between " & lnr & " and " & lnb & " and tfacp200._compnr = tfcmg101.comp and tfcmg101.ttyp = tfacp200.ttyp and tfcmg101.ninv = tfacp200.ninv and tfacp200.docn = 0 "
B_function = "olesql_parse(" & Chr(34) & Query & Chr(34) & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
query_id = Val(BaanObj.ReturnValue)
If query_id = 0 Then
MsgBox "function olesql_parse fails"
GoTo BaanAutomationError
End If
:
Table tfcmg101 is located in company 100, tfacp200 is in various companies > 100.
On LN I always receive zero as a query_id. I suppose the situation depends on the "_compnr"-join, because when I type a static company number instead of "_compnr", it works (but with unreasonable results).
Who can help or explain?
Thx a lot.
Juergen