Visual basic
SQL server
Version 3.0
December 20th, 2010
SelfServing
Trying to duplicate this query.
SQL_Str = "UPDATE InvSlave INNER JOIN [CSA.MDB]." & _
"InvMaster ON InvSlave.InvCorpItem = " & _
"InvMaster.InvCorpItem SET " & _
"InvSlave.InvStockFact = " & facto & _
", InvSlave.DateChanged = #" & _
Now & "#, InvSlave.ChangedBy = " & _
MAINfrmtag & " WHERE (((InvSlave" & _
".InvSellFact)<>" & facto & ") AND " & _
"((InvSlave.InvOrdUnit)= ((InvMaster.InvSellUnit));"
The InvSlave table is in a different database and LLBL project then the InvMaster table.
I tried the following:
Dim expression As New PredicateExpression()
expression.Add(InvSlaveFields.InvSellFact <> facto)
expression.AddWithAnd(InvSlaveFields.InvOrdUnit = InvMasterFields.InvSellUnit)
Dim relations As New HOProfBaseDAL.RelationClasses.DynamicRelation (HOProfBaseDAL.EntityType.InvSlaveEntity, _
JoinHint.Inner, HOcsaDAL.EntityType.InvMasterEntity, "Slave", "Master", InvSlaveFields.InvCorpItem = InvMasterFields.InvCorpItem)
slaveUpdate.InvSellFact = facto
slaveUpdate.DateChanged = Now
slaveUpdate.ChangedBy = MAINfrmtag
ProfTransManager.Add(slaveUpdate)
InvSlaveCol.UpdateMulti(slaveUpdate, expression, relations)
I get the following:
rightOperand can't be null if the left operand isn't a DerivedTableDefinition Parameter name: rightOperand
Am I doing something wrong?
Am I way off base?
Or can't this be done?
Any help would be greatly appreciated.