prabhafriend
02-16-2011, 04:22 AM
I'm analyzing a Historical code by anonymous:
Dim strSQL As String
Dim qrd As QueryDef
Dim sQryName As String
Dim sTemp As String
sQryName = "temp" & Format(Time, "hh:mm:ss")
sTemp = "SELECT TOP 4000 * FROM " & strTableName & ";"
Set qrd = db.CreateQueryDef(sQryName, sTemp)
strSQL = " DELETE * FROM " & sQryName & ";"
Do
db.Execute strSQL, dbFailOnError
Loop Until db.RecordsAffected = 0
I have confusion in whether the user is deleting only the top 4000 records in strTableName or He is deleting all the records in the table but 4000 records at a time. If that's the case why can't he use "DELETE * FROM StarTableName;" Directly. Kindly explain.
Dim strSQL As String
Dim qrd As QueryDef
Dim sQryName As String
Dim sTemp As String
sQryName = "temp" & Format(Time, "hh:mm:ss")
sTemp = "SELECT TOP 4000 * FROM " & strTableName & ";"
Set qrd = db.CreateQueryDef(sQryName, sTemp)
strSQL = " DELETE * FROM " & sQryName & ";"
Do
db.Execute strSQL, dbFailOnError
Loop Until db.RecordsAffected = 0
I have confusion in whether the user is deleting only the top 4000 records in strTableName or He is deleting all the records in the table but 4000 records at a time. If that's the case why can't he use "DELETE * FROM StarTableName;" Directly. Kindly explain.