I try to do some function by using if and then to switch between insert and update but it can't work... can anyone give me a hand please....
this is my coding:
SQL = "SELECT equip_id FROM tracking WHERE equip_id='"&equip_id&"' "
set rs1 = openConn.Execute(SQL)
dim compare
compare=(rs1("equip_id")
if compare!=null Then
tSQL ="UPDATE tracking SET status='"&status&"' WHERE equip_id='"&equip_id&"' "
set rs = openConn.Execute(tSQL)
else
sSQL = "INSERT INTO tracking"
sSQL = sSQL &"(status)"
sSQL = sSQL &"VALUES ('"&status&"')"
set rs = openConn.Execute(sSQL)
this is my coding:
SQL = "SELECT equip_id FROM tracking WHERE equip_id='"&equip_id&"' "
set rs1 = openConn.Execute(SQL)
dim compare
compare=(rs1("equip_id")
if compare!=null Then
tSQL ="UPDATE tracking SET status='"&status&"' WHERE equip_id='"&equip_id&"' "
set rs = openConn.Execute(tSQL)
else
sSQL = "INSERT INTO tracking"
sSQL = sSQL &"(status)"
sSQL = sSQL &"VALUES ('"&status&"')"
set rs = openConn.Execute(sSQL)