This is a sql query wirtten in vb. this query works fine with sql server. but with paradox it does because in the query "IF EXISTS" is there and Paradox does not understand IF EXISTS. IS there any other way we can write this query and keep the meaning the same too as the orgianal one. Please advise, its urgent. regards rajiv
GetClientRs f_hierarchy.connectstring, _
"IF EXISTS(" _
+ "SELECT * " _
+ "FROM term_prop " _
+ "WHERE hier_id=" & f_hierarchy.id & " " _
+ "AND term_id=" & f_term_id & " " _
+ "AND hier_prop_id=" & f_propertydefinition.id & " " & vbCrLf _
+ "UPDATE term_prop SET hier_prop_value_id=" & pdvid & " " _
+ "WHERE hier_id=" & f_hierarchy.id & " " _
+ "AND term_id=" & f_term_id & " " _
+ "AND hier_prop_id=" & f_propertydefinition.id & " " _
+ " ELSE " _
+ "INSERT INTO term_prop (hier_id, term_id, hier_prop_id, hier_prop_value_id) " _
+ "VALUES " _
+ "(" & f_hierarchy.id & "," & f_term_id & "," & f_propertydefinition.id & "," & pdvid & ""
GetClientRs f_hierarchy.connectstring, _
"IF EXISTS(" _
+ "SELECT * " _
+ "FROM term_prop " _
+ "WHERE hier_id=" & f_hierarchy.id & " " _
+ "AND term_id=" & f_term_id & " " _
+ "AND hier_prop_id=" & f_propertydefinition.id & " " & vbCrLf _
+ "UPDATE term_prop SET hier_prop_value_id=" & pdvid & " " _
+ "WHERE hier_id=" & f_hierarchy.id & " " _
+ "AND term_id=" & f_term_id & " " _
+ "AND hier_prop_id=" & f_propertydefinition.id & " " _
+ " ELSE " _
+ "INSERT INTO term_prop (hier_id, term_id, hier_prop_id, hier_prop_value_id) " _
+ "VALUES " _
+ "(" & f_hierarchy.id & "," & f_term_id & "," & f_propertydefinition.id & "," & pdvid & ""