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
|
 |
 |
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. |
 |
 |
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. |
 |
 |
klipkop
Posts: 16
|
| Posted: 06/07/2007, 11:24 PM |
|
Thanks Smalloy
DBAMSData.Execute(sSQL) was the missing thing... me learning.
|
 |
 |
|