We help IT Professionals succeed at work.

SQL Delete * Only Deleting a Single Record on Linked Table

SuperLight
SuperLight asked
on
Medium Priority
324 Views
Last Modified: 2012-05-12
Hi Experts,

I'm experiencing an issue with deleting records on the Linked Table (Oracle) from MS Access 2007.  I'm executing the following in VBA:

CurrentDb.execute Delete TableName.* FROM TableName

I expect this would delete all records, however it's just deleting 1 record.

Any help would be appreciated.

Thanks

Mark
Comment
Watch Question

Dale FyeOwner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010
Commented:
Try:

CurrentDb.execute "Delete * FROM TableName", dbfailonerror
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
Try this and see if an error is raised:

CurrentDb.execute Delete TableName.* FROM TableName , dbFailOnError
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Is this Table involved in an Relationships ?  If so, this is likely the cause of the problem .... Referential Integrity may be preventing deleting of records.

mx
Works a treat thanks.

Mark

Author

Commented:
50/50 split seems only fair!

thanks
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Well, what do you mean 'worked'.  Was a error exposed ? If so what error ... just curious ...

mx

Explore More ContentExplore courses, solutions, and other research materials related to this topic.