Solved

If record exists

Posted on 2001-06-04
1
123 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now