USE DBF(m.cSourceCursor) ALIAS (m.cTargetCursor) AGAIN exclbecause the cursor is still open, you can not re-open it again exlusivly - duh. now the funny thing is, this does not error (normaly it should error ("file in use").
> IF USED("q_Pn_InvLoc") > SELE q_Pn_InvLoc > CLOSE INDEXES > USE IN q_Pn_InvLoc > ENDIF > > IF IsBlank(m.FromWhse) > WAIT WIND "Collecting all parts in warehouses, please wait..." NOWAIT > QuerryFlt = ".t." > FromStr = ; > "invloc q_a" > ELSE > WAIT WIND "Collecting all parts in warehouse " +m.FromWhse+ ", please wait..." NOWAIT > QuerryFlt = "q_a.whse = m.FromWhse" > FromStr = ; > "invloc q_a" > ENDIF > > SELE ; > q_a.* ; > FROM &FromStr ; > WHERE &QuerryFlt ; > INTO CURSOR q_Temp_Pn_InvLoc > > oToolBox.oLocalSQL.MakeCursorReadWrite("q_Temp_Pn_InvLoc", "q_Pn_InvLoc", , 'excl') > SELE q_Pn_InvLoc > INDEX ON pn TAG pn ADDI && error here > INDEX ON pn+opt1+opt2+opt3+opt4+opt5+opt6+opt7+opt8+whse TAG pn3 ADDI && error here > SET ORDER TO pn3 > >procedure oToolBox.oLocalSQL.MakeCursorReadWrite >LPARA ; > cSourceCursor, ; > cTargetCursor, ; > nDS, ; > cUserType >LOCAL ; > OldSelect, ; > ReturnValue, ; > nCurrDS > >* *** ********************************************************************************** >* *** this method will make out of a read-only cursor a read/write cursor >* *** cSourceCursor -> alias from read-only cursor >* *** cTargetCursor -> optional >* *** if passed, the passed alias name is used to create the >* *** read/write cursor. if not passed the original alias name is >* *** used to create it. >* *** returned is the new cursor alias name >* *** ********************************************************************************** > >ReturnValue = "" > >nCurrDS = SET("DataSession") >IF TYPE("m.nDS") = "N" .AND. m.nDS <> m.nCurrDS > SET DATASESSION TO (m.nDS) >ENDIF > >IF USED(m.cSourceCursor) > OldSelect = SELECT() > IF TYPE("m.cTargetCursor") <> "C" .OR. IsBlank(m.cTargetCursor) > cTargetCursor = m.cSourceCursor > ENDIF > ReturnValue = m.cTargetCursor > > SELE 0 > IF UPPER(ALLT(m.cTargetCursor)) = UPPER(ALLT(m.cSourceCursor)) > USE DBF(m.cSourceCursor) ALIAS cur_ReadWrite_Temp AGAIN > USE IN (m.cSourceCursor) > SELE 0 > if Type("m.cUserType") = "C" .and. upper(m.cUserType) = "EXCL" > USE DBF("cur_ReadWrite_Temp") ALIAS (m.cTargetCursor) AGAIN excl > else > USE DBF("cur_ReadWrite_Temp") ALIAS (m.cTargetCursor) AGAIN > endif > USE IN cur_ReadWrite_Temp > ELSE > if Type("m.cUserType") = "C" .and. upper(m.cUserType) = "EXCL" > USE DBF(m.cSourceCursor) ALIAS (m.cTargetCursor) AGAIN excl > else > USE DBF(m.cSourceCursor) ALIAS (m.cTargetCursor) AGAIN > endif > USE IN (m.cSourceCursor) > ENDIF > > SELECT(m.OldSelect) >ENDIF > >IF TYPE("m.nDS") = "N" .AND. m.nDS <> m.nCurrDS > SET DATASESSION TO (m.nCurrDS) >ENDIF >RETURN(m.ReturnValue) >endprocedure>thank for any help you can provide in advance!