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

 INVOKE a stored procedure from a button

Print topic Send  topic

Author Message
klipkop

Posts: 16
Posted: 06/06/2007, 10:31 AM

Hi

I can't find a way to do a very simple thing...

I have a field and a button in CSS and a stored procedure in MS SQL. I want the on click event of the button to pass the variable to the SP and invoke the SP (Which insert records into a table)

All that I can find is to use SP to get data from a DB - Surely it can kick of a SP ?

Assistance will be appreciated ...

Andre
View profile  Send private message
smalloy

Posts: 107
Posted: 06/07/2007, 1:32 PM

Of Course you can and its simple, here are the steps:

1. In the Button Server On-Click Event set it to ADD Code

2. You will need a DB connection so declare your vatuables:

  
Dim  sSQL  
DIM strPolicyType  
	' Connections, record sources  
Dim DBAMSData, rs  
  
	Set DBAMSData = New clsDBAMSData  
	  
	DBAMSData.Open  
  
  
  
  
  

_________________
Anything can be done, just give me time and money.
View profile  Send private message
smalloy

Posts: 107
Posted: 06/07/2007, 1:36 PM

Sorry, here's the rest

Dim myParameter
myParameter = xxxxxxxxx

' The SQL Statement
sSQL= "EXEC spMyStoredProceedre;1 " & myParameter

'Execute the SP
DBAMSData.Execute(sSQL)

'Don't forget to close the DB connection
If DBAMSData.State = adStateOpen Then _
DBAMSData.Close
Set DBAMSData = Nothing

Good luck!
_________________
Anything can be done, just give me time and money.
View profile  Send private message
klipkop

Posts: 16
Posted: 06/07/2007, 11:24 PM

Thanks Smalloy

DBAMSData.Execute(sSQL) was the missing thing... me learning.
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.

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.