ressurecting the dead...

I'm working on the same sort of thing, but I'm having issues \:\)

 Code:
break on
$ = setoption('wrapateol','on')

$cnstring = "DRIVER={SQL Server};SERVER=wheeler-sqlsrv;UID=Inventory;PWD=kixscript;DATABASE=inventory"

$cmdtxt = "select * from _tbl_Main where Wksta = '@WKSTA'"
$cn=CreateObject("ADODB.Connection")
$cmd=CreateObject("ADODB.Command")
$rs=CreateObject("ADODB.RecordSet")
? 'Error = '+@ERROR+' - '+@SERROR

$cn.connectionstring = $cnstring
$cn.open
? 'Error = '+@ERROR+' - '+@SERROR

$cmd.activeconnection = $cn
$rs.cursortype = 3
$rs.locktype = 3
$rs.activecommand = $cmd
? 'Error = '+@ERROR+' - '+@SERROR

$cmd.commandtext = $cmdtxt $rs.open ($cmd)
? 'Error = '+@ERROR+' - '+@SERROR


;*** ADD RECORDS TO THE DATABASE ***

IF $rs.eof = -1 ; addnew is only needed if a record for this workstation was not found.
	$rs.addnew
ENDIF

$rs.fields.item("wksta").value = '"'+@wksta+'"'
$rs.fields.item("Model").value = "PC Model"
$rs.fields.item("IPAddr").value = '"'+@ipaddress0+'"'
$rs.fields.item("UserID").value = '"'+@userid+'"'

$rs.update
? 'Error = '+@ERROR+' - '+@SERROR

$rs.close


returns
 Code:
Error = 0 - The operation completed successfully.
Error = 0 - The operation completed successfully.
Error = -2147352562 - Invalid number of parameters.
Error = 0 - The operation completed successfully.
Error = 0 - The operation completed successfully.


and it always writes new records to the DB, no updates

Suggestions?
_________________________
How to ask questions the smart way <-----------> Before you ask