HELP please, with function that returns an array
I'm trying to write a function that returns an array and I can't figure it out.
I know this is a very newbie question but I am new to ASP
Here's the function:
Dim rs, page_id, con, data_source
data_source = "Provider=SQLOLEDB.1;Password=pword;Persist Security Info=True;User ID=user_name;Initial Catalog=adb;Data Source=someIpAddress"
Set con = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs.ActiveConnection = con
rs.Open "select max(id) as cur_record from mortgage_rate where page = 'h'"
page_id = rs("cur_record")
page_id_cvt = CInt(page_Id)
rs.Open "select * from mortgage_rate where id = " & page_id_cvt
page = rs("page")
rate = rs("rate")
ap_rate = rs("ap_rate")
caps = rs("caps")
term_id = rs("term_id")
points = rs("points")
payment = rs("payment")
last_date = rs("date_last_modified")
SimpleRates = array(page, rate, ap_rate, caps, term_id, points, payment, last_date)
not sure about this one, but just for ****s and giggles try this:
set SimpleRates = array(page, rate, ap_rate, caps, term_id, points, payment, last_date)
and also when you call the function use set i.e.
set blah = simpleRates()