/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Delete all Records in Recordset

Is there an easy way to delete all the records in a recordset? I know this code, but it will only delete the current record that you’re at. Thanks!

[CODE]
rsRecordset.Delete
[/CODE]

to post a comment

6 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJan 17.2007 — <i>
</i>rsRecordset.Execute("DELETE * FROM tblname")
Copy linkTweet thisAlerts:
@nbcrockettauthorJan 17.2007 — Is there a way to do it with an already open recordset?
Copy linkTweet thisAlerts:
@gil_davisJan 17.2007 — Huh?

Just change "SELECT" to "DELETE" in the querystring and execute the query.
Copy linkTweet thisAlerts:
@nbcrockettauthorJan 17.2007 — I can't do that. I'm using the data in the recordset for something. Once I've used the data in the recordset I want to delete it. Should I just close the recordset then reopen it using DELETE instead of SELECT? I'd rather not, I've already got a dozen recordsets opening and closing on this page.
Copy linkTweet thisAlerts:
@gil_davisJan 17.2007 — Well, all I can say to that is "timing is everything", isn't it?

Looks like your choice is to delete as you use it or wait until you are done and delete it all. Are you looking for something else?
Copy linkTweet thisAlerts:
@nbcrockettauthorJan 17.2007 — No, I think that gives me my answer, thanks!
×

Success!

Help @nbcrockett spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...