Hi I'm trying to remove an entry in a database table and need it to be a "NULL". Does anyone know how this can be done? Below is my base code.

 Code:
        $machine = @WKSTA
        $Extension = "999"
        $UsersKey = @USERID
        $Active = "N"
        $Clientkey="NULL"
        
    
        $cnstring = 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=Database1;Data Source=SQLServer6;Password='
        $cmdtext = "SELECT * FROM XXXWorkstation where workstationkey = '" + $machine + "'"
        $cn = CreateObject("adodb.connection") 
        $cmd = CreateObject("adodb.command") 
        $cn.connectionstring = $cnstring 
        $cn.Open 
        $cmd.activeconnection = $cn 
        $cmd.commandtext = $cmdtext 
        
        $rs = CreateObject("adodb.recordset") 
        $rs.cursortype = 3 
        $rs.locktype = 3 
        $rs.Open($cmd)
        

            $rs.Fields.Item("Extension").Value = $Extension
            $rs.Fields.Item("MachineKey").Value = $MachineKey
            $rs.Fields.Item("UsersKey").Value = $UsersKey
            $rs.Fields.Item("Active").Value = $Active
            $rs.Fields.Item("Clientkey").Value = $Clientkey

            
            $rs.Update
        
        $rs.Close
        $cn.Close


If I use a number in the $clientkey all works fine without error.

Thanks in advance.

Paul



Edited by paulba (2010-10-19 06:15 AM)