CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 After Execute Insert Event

Print topic Send  topic

Author Message
Nathaniel
Posted: 06/13/2003, 3:00 PM

CCS 2.1.1.20
ASP

I created a session variable in the "Before Insert" event to save a control value.

I attemt to use the session variable in the "After Execute Insert" in the where clause to find and increment a column in a second table.

Listed below is the custom "After Execute Insert" code. I am not very good at sql and cannot figure out my problem. Any help would be appreciated, this is the last item I need to complete to finish a class registration form. If there is a better way, please let me know.

Line 41 is the sql statement and column 80 is the third "s" in the word session.

=========================== Custom "After Execute Insert" code ================

Dim SQL
Dim Connection
Dim ErrorMessage
Dim testnumber

SQL = "Update Classes set ClassCount = ClassCount + 1 WHERE ClassID = session("class_id")"

Set Connection = New clsDBadminDB
Connection.Open
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0

================================= Error Message ================================



Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/admin/class_registration_events.asp, line 41, column 80
rrodgers
Posted: 06/13/2003, 3:50 PM

>>SQL = "Update Classes set ClassCount = ClassCount + 1 WHERE ClassID = session("class_id")"

SQL = "Update Classes set ClassCount = ClassCount + 1 WHERE ClassID = " & session("class_id")

That is is Class_id is numeric. If it is a string then you will have to add quotes around the session() function.

rob
Nathaniel
Posted: 06/13/2003, 4:15 PM

Rob,

Thank you a thousand times. Your suggestion worked. You also helped me with a previous problem. I want you to know that the registration form that I am working on is for my church.

Its going to really make life easier for our Minister of Christian education.

Have a blessed day.

Nat
rrodges
Posted: 06/14/2003, 7:17 AM

I am glad it is working for you.

rob

   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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