kd5jnx
Posts: 5
|
| Posted: 09/13/2004, 1:00 PM |
|
Hello All, I am new to CCS and am having a little problem. I would like to have a DB Admin page that only administrators can get to..I know that is easy enough. On this page I would like to put some buttons to handle some Database cleanup jobs.
1. Run an SQL that will delete records that are over 14 days old. DELETE * FROM TBLUSERLOG WHERE DATETIME <= Now()-14
2. Run an SQL that will append data from 1 table to another, then run sql that will delete records based on that same criteria. Just to keep records that we need to keep in another table..but not load down the table that is always accessed.
3. Run the "Compact and Repair Database" Utility.
Much thanks in advance, Marc
|
 |
 |
kd5jnx
Posts: 5
|
| Posted: 09/14/2004, 11:01 AM |
|
ANYBODY???
|
 |
 |
kd5jnx
Posts: 5
|
| Posted: 09/15/2004, 8:52 AM |
|
The CodeCharge support staff has provided the solution for everything except the Compact and Repair Issue, which I did not include in my correspondance with them and I think is gonna be difficult to answer anyway. Thanks Chris
|
 |
 |
S_A
Posts: 29
|
| Posted: 09/17/2004, 6:50 AM |
|
Hi,
Any chance you could share that information please as I have exactly the same question?
Thanks!
|
 |
 |
john
|
| Posted: 09/17/2004, 7:01 AM |
|
Just press the red button at the top of the database index function page, and all the code for this will be generated automatically.
|
|
|
 |
kd5jnx
Posts: 5
|
| Posted: 09/17/2004, 7:13 AM |
|
I was trying to delete old records from a button click. This took care of my problem and works great.
SQL = "DELETE * FROM TBLUSERLOG WHEN DATETIME <= Now()-14"
CCExecSQL SQL, DBCLSWEB, true
I other examples they were showing this:
Dim Connection
Dim SQL
Connection=New clsDBCLSWEB
Connection.open
SQL="DELETE * FROM TBLUSERLOG WHEN DATETIME <= Now()-14"
Connection.Execute (SQL)
Connection.close
Connection=Nothing
That never would work for me, Although I am now trying the same thing with a more complex SQL String that isnt working either way I try it.
Hope that helps.
|
 |
 |
|