Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting Records from an Access Database

Status
Not open for further replies.

sysadmin07

IS-IT--Management
Joined
Feb 20, 2007
Messages
41
Location
US
Hi,

I'm trying to delete multiple rows from an Access database. I'm having trouble figuring out how to call entries that are differentiated by -1, -2, -3, etc. (outlined below under the "Name" heading). How would I go about deleting the John-1, John-2, and John-3 rows? FYI, this is a rather large database and I've listed a few test entries below, so please don't question the logic of its structure:

Name Job Description
John-1 Clerical
John-2 Reception Desk
Mary-1 Custodial
John-3 Accounting

Here's the start of my delete code:

<CFQUERY NAME="deleteItem" DATASOURCE="test">
DELETE * FROM tableJobs
WHERE name='#????????#';
</CFQUERY>

Thank you
 
Assuming the first part of the name is known

<CFSET FirstNamePart = "John">
<CFQUERY NAME="deleteItem" DATASOURCE="test">
DELETE * FROM tableJobs
WHERE name ='#FirstNamePart#-%';
</CFQUERY>

 
is the wildacrd % or * ??

this is msaccess, and yet i know there's a difference between AOD and DOA... or is it DAO and AOD...

oh dear...

r937.com | rudy.ca
 
I think its "*" if you're querying directly in Access (or possibly using ADO? Not sure?

And its "%" if you're using cfquery (ie ODBC or JDBC-ODBC)

(good grief. Could we possibly have any more acronyms? ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top