Query using an array
hi, attempting return figures based on file being passed asp page, file csv, split , enter details array. works, have checked, when attempting query database using array having problems, have shown code attempted, no joy.
the database connection working have tried , tested it.
any appreciated, thanks.
<%
for = lbound(dzarray) ubound(dzarray)
if dzarray(i) <> "" '... error check insure no vbnull value comes through array
set rssearch = con.execute("select * myepopbynewagegroups myepopbynewagegroups.datazone = '" & dzarray(i) & "'")
if not rs.eof '... error check insure value returned select statement
while not rssearch.eof
%>
<tr>
<td><%= rssearch("datazone")%></td>
<td><%= rssearch("under 5")%></td>
<td><%= rssearch("5-15")%></td>
<td><%= rssearch("16-24")%></td>
</tr>
<%
rssearch.movenext
wend
end if
%>
the database connection working have tried , tested it.
any appreciated, thanks.
<%
for = lbound(dzarray) ubound(dzarray)
if dzarray(i) <> "" '... error check insure no vbnull value comes through array
set rssearch = con.execute("select * myepopbynewagegroups myepopbynewagegroups.datazone = '" & dzarray(i) & "'")
if not rs.eof '... error check insure value returned select statement
while not rssearch.eof
%>
<tr>
<td><%= rssearch("datazone")%></td>
<td><%= rssearch("under 5")%></td>
<td><%= rssearch("5-15")%></td>
<td><%= rssearch("16-24")%></td>
</tr>
<%
rssearch.movenext
wend
end if
%>
not sure you're trying accomplish here here's example of similar i've done. code loops through array of submitted form check boxes , adds each 1 shopping cart.
<%
checkedproducts = request.form("atccheck")
checkedproductssplit = split(checkedproducts,",")
for = lbound(checkedproductssplit) ubound(checkedproductssplit)
%>
<%
dim rsaddeditems
dim rsaddeditems_cmd
dim rsaddeditems_numrows
set rsaddeditems_cmd = server.createobject ("adodb.command")
rsaddeditems_cmd.activeconnection = mm_connkennysmdidata_string
rsaddeditems_cmd.commandtext = "select kennysinventoryid, productdescription1, productid, productname, unitprice, weight products productid = "&checkedproductssplit(i)&""
rsaddeditems_cmd.prepared = true
set rsaddeditems = rsaddeditems_cmd.execute
rsaddeditems_numrows = 0
%>
<%
'add item shopping cart
%>
<%
next
%>
<%
rsaddeditems.close()
set rsaddeditems = nothing
%>
<%
checkedproducts = request.form("atccheck")
checkedproductssplit = split(checkedproducts,",")
for = lbound(checkedproductssplit) ubound(checkedproductssplit)
%>
<%
dim rsaddeditems
dim rsaddeditems_cmd
dim rsaddeditems_numrows
set rsaddeditems_cmd = server.createobject ("adodb.command")
rsaddeditems_cmd.activeconnection = mm_connkennysmdidata_string
rsaddeditems_cmd.commandtext = "select kennysinventoryid, productdescription1, productid, productname, unitprice, weight products productid = "&checkedproductssplit(i)&""
rsaddeditems_cmd.prepared = true
set rsaddeditems = rsaddeditems_cmd.execute
rsaddeditems_numrows = 0
%>
<%
'add item shopping cart
%>
<%
next
%>
<%
rsaddeditems.close()
set rsaddeditems = nothing
%>
More discussions in Develop server-side applications in Dreamweaver
adobe
Comments
Post a Comment