if instr($sComputer,'\')
$sComputer = right($sComputer,instrrev($sComputer,'\'))
Endif


could be replaced by

$sComputer = trim(join(split($sComputer,'\'),''))

and I screwed up this line...

$sQuery = $sQuery+" Where "+$sWhere+" = '"+$x+"'"

(this one works)
_________________________
How to ask questions the smart way <-----------> Before you ask