CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Application Question

Print topic Send  topic

Author Message
jshulse

Posts: 9
Posted: 01/25/2007, 8:43 AM

I have a project mangement app that I wrote w/ CCS 3. It works fine but the situation is that because I have to pass a Project ID and because I have to have a security field for each project I have had to re-generate the code each time I have a new project. The only change is that I hard code the project ID and in the settings area I tell it which field in the security table is for this project. I am wondering if anybody else has run into a problem like this and what was done to come up with a more "elegant" solution.

Jan
View profile  Send private message
peterr


Posts: 5971
Posted: 01/25/2007, 12:41 PM

Try placing this code into the "Before Execute Insert" or "Before Execute Update" event:
Response.Write Your_form_name.Command.SQL  
Response.End
(replace "Your_form_name" with your actual form name)

This will display the SQL statement that is being executed when inserting or updating records. Then you can write some ASP code that will replace part of that SQL with whatever you need, like:
Your_form_name.Command.SQL = Replace(Your_form_name.Command.SQL, "field1", "field2")
(untested)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
jshulse

Posts: 9
Posted: 01/25/2007, 1:35 PM

Thanks for the fast reply, but I guess I'm a little dense. I reaaly don't need to change anything in the code except I need to load the project id into a session variable and i need to be able to specify which field in the security table to use for determining security level based on the project id.

Jan
View profile  Send private message
peterr


Posts: 5971
Posted: 01/29/2007, 2:58 AM

Jan,

You'd use the above code on your user maintenance form, to dynamically save project id or anything else into a different field (or table).

The rest is even simpler - just modify the SQL statement in the CCLoginUser function in Common.asp. There you can read whichever field you prefer, or determine it dynamically.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
jshulse

Posts: 9
Posted: 01/29/2007, 6:29 AM

Peterr,

Thanks for the 2nd reply I will give it a try and let you know how it worked out.\

Jan
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.