#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Maine
    Posts
    9
    Rep Power
    0

    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")
    con.Open data_source
    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")
    rs.Close
    page_id_cvt = CInt(page_Id)
    rs.Open "select * from mortgage_rate where id = " & page_id_cvt
    page = rs("page")
    rate = rs("rate")
    Response.Write(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)
    rs.Close
    con.Close

    end function
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    NJ
    Posts
    428
    Rep Power
    16
    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()
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Maine
    Posts
    9
    Rep Power
    0
    Thank you very much.

IMN logo majestic logo threadwatch logo seochat tools logo