Solved

If record exists

Posted on 2001-06-04
1
125 Views
Last Modified: 2010-05-02
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
Comment
Question by:fayb
1 Comment
 
LVL 15

Accepted Solution

by:
robbert earned 50 total points
ID: 6152291
No. If there is no sName in the database, the DELETE statement will not have any effect.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question