|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
passing the result of an sql statement into an asp variable
Hey guys
Just got back from a half marathon and my brain is leaking more than my shower... I've got me an sql statement that uses the count facility, hence im expecting a numeric value to be returned when the query is executed. However, I want to run a series of if statements against the result - so I guess I need to get the result into a variable or such, to do the work on. Problem is, I dont know how. Worse still, it seems that nowhere on the web is a tutorial telling you how... So please, I beg you, sort me out a little snippet of code so that I can be a happy man Chris |
|
#2
|
|||
|
|||
|
Snippet it is, not complete by any means
Code:
set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT COUNT(*) as MyCount FROM myTable", myConnectionString
myVariable = rs("MyCount")
rs.close
set rs = nothing
|
|
#3
|
|||
|
|||
|
Cheers mate - worked a treat.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > passing the result of an sql statement into an asp variable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|