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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar for a Delete Query

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
0
0
US
Is it possible to have a progress bar show the status of a delete query for duplicates? Then the user will know when the delete action is complete.

My delete query is:
sSQL = "DELETE [Lab Table].TDate, [Lab Table].ID, * FROM [Lab Table] WHERE ((([Lab Table].TDate) Between Date()-20 And Date()) AND (([Lab Table].ID) Not In (SELECT Min(ID) as MinID FROM [Lab Table] WHERE ([Lab Table].TDate Between Date()-20 And Date()) GROUP BY [Lab Table].LotNumber)));
 
Seems unlikely. Your VB code doesn't run the DELETE statement ... the DBMS does and it doesn't return any status information until it's done. Guess you could start a timer and use it to increment a progress bar until you get control back from the statement that submitted the database DELETE.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Are you aware of any smamples, that I could look at for an idea of how to do that. Thank you!!
 
You could use a process bar. I know there is a sample here someplace, but I couldn't find it. Basicly you can use a status bar and 2 gradiants moving back and forth to give you the old Netscape/Knight Rider style process bar. similar to this:
Process.bmp


-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Or you could simply do
1) select command instead of a delete - results to datatable
2) scan through the table and do a delete on the primary key of each record in your table. This way you know how many records are to be deleted. Also I would wrap the whole series of deletes in a transaction loop


Sweep
...if it works, you know the rest..
Always remember that Google is your friend

curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top