SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ********* Addict DLG_1's Avatar
    Join Date
    Jun 2000
    Location
    Texas, USA
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reusing recordsets - newbie

    I'm sending a query in the page and if there are no recordsets returned, then i need to immediately send another query and print those results.

    here's my "non-working" code

    [VBS]Set cn = server.CreateObject("ADODB.Connection")
    cn.Open "Provider=SQLOLEDB; Data Source= SQLECM02; Initial Catalog= wwwapp; user id= ecm_user; Password = ecm_user"

    Set rs = server.CreateObject("ADODB.Recordset")
    rs.Open "Select url, fName, lName from users as u, role as r, security as s where u.ntID ='" & user & "' and u.roleid = r.roleid and s.securityLevelReq <= r.securitylevel and s.securityLevelReq > 0;", cn
    if rs.BOF and rs.EOF Then
    rs.clear
    rs.Open "Select url from security where securitylevelreq = 0"
    end if


    [/VBS]

    please help.

  2. #2
    ********* Addict DLG_1's Avatar
    Join Date
    Jun 2000
    Location
    Texas, USA
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rs.close

    duh.

  3. #3
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Happens to us all from time to time!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •