Code:
set rs = conn.Execute("SELECT * FROM <%= rs("AccNumber")%> ORDER BY ID")
The above would only work if you were writing "set rs ..." to the page. If this was in ASP code you would be nesting <% and %> which you cannot do!
Either assign the value from the recordset to a variable
Code:
<%
Dim myVar
myVar = rs("AccNumber")
%>
And use it later
Code:
<%
set rs = conn.Execute("SELECT * FROM " & myVar & " ORDER BY id")
%>
Also note that in the example you provided you were using the same recordset variable (rs) to refer to two separate
open objects; which will fail! You can achieve the same effect using two separate recrodsert objects
Code:
<%
set rs1 = conn.Execute("SELECT * FROM " & rs2("AccNumber") & " ORDER BY id")
%>
Finally, you have a syntax error in your SQL; unless of course your tables are named after account numbers!!
Code:
SELECT col1, col2, ... , colN
FROM tableName
WHERE col1 = <someValue>
ORDER
BY col1
Hope this helps!