Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 131
  • Last Modified:

If record exists

In vb5, I have code that works fine to delete a record if the name is "Brown"

sName = Brown
Set dbtemp = OpenDatabase(dbname)
    dbtemp.Execute "DELETE * FROM List1 WHERE Name = " & "'"  &  sName & "'"
dbtemp.Close

Do I need a trap in case there are is no Brown in the Name field.
0
fayb
Asked:
fayb
1 Solution
 
robbertCommented:
No. If there is no sName in the database, the DELETE statement will not have any effect.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now