CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 run sql from button event

Print topic Send  topic

Author Message
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
View profile  Send private message
kd5jnx

Posts: 5
Posted: 09/14/2004, 11:01 AM

ANYBODY??? :-/
View profile  Send private message
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 :-)
View profile  Send private message
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!
View profile  Send private message
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.