First I don't want a UDF as thats keeping the Sql statements in the code and not in the database. This is why I'm trying to pass the variable like I am. Here I'm trying to pass the $DomainPC to the Database and get it to return anything.. Some indicator that it either sees it in the database or not. $Recordset.open("call _RA2011_All_PCINFO ('@" & $DomainPc & "');", $Connection) If $Recordset.RecordCount <> 0 Then else GUICtrlSetData($Edit, "Found New Device: " & $Domai