First you have to open a RecosdSet, get these columns and then perform any calculations. A typical example is like this:
Dim strSQL,intCounter
Dim arraySum()
intCounter=0
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open "place the connection string here"
Set objRs=Server.CreateObject("ADODB.RecordSet")
strSQL="SELECT column1, column2, column3 FROM table_name WHERE your_conditions"
objRs.Open strSQL, objConn
Do While Not objRs.EOF
arraySum(intCounter)=cint(objRs("column1")+objRs(" column2")+objRs("column3"))
intCounter=intCounter + 1
objRs.MoveNext
Loop
objRs.Close
Set objRs=Nothing
objConn.Close
Set objConn=Nothing
After that the arraySum contains the sums for each row of your three columns
Cheers
Kostas Lagos
|