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

    Join Date
    Feb 2003
    Posts
    9
    Rep Power
    0

    how do i run 2 pieces of sql at the same time on the same page?


    hi.
    i want to run two pieces of sql that connect to two different tables that are not assosiated with each other, in 1 asp file. how do i do this.
    i have one at the moment

    <%
    dim adoConn
    dim sConn

    set adoConn = Server.CreateObject("adodb.connection")
    make_connection adoConn, ........

    dim sSqlSelectBlah
    dim adoRsBlah
    set adoRsBlah = Server.CreateObject ("adodb.recordset")

    sSqlSelectBlah ="SELECT foo from bar ......."

    adosRsBlah.open sSqlSelectBlah, adoConn, 3
    %>
    <body>
    <%
    adoRsBlah.Close
    adoConn.Close
    %>
    </body>

    how would i include a second piece of sql that accesses a different table?
    cheers

    j
  2. #2
  3. No Profile Picture
    Overly white
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Fresno, CA
    Posts
    83
    Rep Power
    12
    Just create a second recordset object and a second querey and then open it just like the first.

    adoRS2.open sql2, adoconn

IMN logo majestic logo threadwatch logo seochat tools logo