CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Button OnClick Server Event to Execute Procedure

Print topic Send  topic

Author Message
Andres Rormoser
Posted: 11/06/2004, 3:25 PM

I'm trying to develop a simple page with one button and when you press the
button it execute a store procedure.

I add a dummy grid form add a button inside it and put the following code in
the Onclick Server Event of the button:


Dim SQL
Dim Connection
Dim ErrorMessage

Set Connection = New clsDBConnection1
Connection.Open
SQL = "EXEC generar_facturas"
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0


But when i pressed the button the page get's reloaded but no prodedure it's
executed.

What am i doing wrong?

Thanks in advance, AR

DonB
Posted: 11/07/2004, 2:14 PM

"CCProcessError"??

What is that? If you hadn't said "Onclick Server Event", I'd have guessed
you are using CodeCharge (not Code Charge Studio). My superficial knowledge
of CC is that "event" don't exist in that product. I don't find that
function in CCS V2.3, either.

My guess is there's an error In the ErrorMessage variable that you never
see. Having the On Error Goto 0 suggests that you (somewhere) have a On
Error Resume Next so the normal error display fails.

Try putting these lines of code before the Connection.Close:

print "<br>ErrorMessage=" & ErrorMessage
print "<br>Error=" & Err.Number & ", " & Err.Description
Response.End

and see what you get.

--
DonB

http://www.gotodon.com/ccbth


"Andres Rormoser" <arormoser@witcom.com.ar> wrote in message
news:cmjmho$1dd$1@news.codecharge.com...
> I'm trying to develop a simple page with one button and when you press the
> button it execute a store procedure.
>
> I add a dummy grid form add a button inside it and put the following code
in
> the Onclick Server Event of the button:
>
>
> Dim SQL
> Dim Connection
> Dim ErrorMessage
>
> Set Connection = New clsDBConnection1
> Connection.Open
> SQL = "EXEC generar_facturas"
> Connection.Execute(SQL)
> ErrorMessage = CCProcessError(Connection)
> Connection.Close
> Set Connection = Nothing
> On Error Goto 0
>
>
> But when i pressed the button the page get's reloaded but no prodedure
it's
> executed.
>
> What am i doing wrong?
>
> Thanks in advance, AR
>
>


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.

Web Database

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.