|
-
Nov 22nd, 2000, 09:43 AM
#1
Thread Starter
New Member
Hi, my question is about Vbscript in ASP.
If I have 150 records in a MS access table, in which there is no field of record number. I want to write a statement to DELETE all previous records (e.g here number 1-50 records)and to keep the last 100 records (number 51-100). If the table contains 430 records, I want to keep only the last 100 records, which are the record of number 331 to 430; and which are involved within number 1 to 330 are DELETED
I try the following statement, but it DELETE all records
Dim rsUser
Set rsUser = Server.CreateObject("ADODB.Recordset")
rsUser.Open "theTablename", objConnection, _
.....<constant>..., adcmdTable
rsUser.Filter
rsUser.Delete
rsUser.Update
OR
Dim rsUser, strSQL
Set rsUser = Server.CreateObject("ADODB.Recordset")
strSQL = "DELECT FROM theTablename"
rsUser.Open strSQL, objConnection, _
.....<constant>..., adcmdText
Thanks for any reply
David
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|