|
bobby -> RE: array question (2/5/2003 12:50:13)
|
I have another question guys... Why is it that .getrows above is only grabbing the first 3 records in the DB? I removed the Where clause from the Select statement, still only grabs the first three... I added:
myArray=" "
myArray=rsMail.getrows
to try and " clear" it out each time, but it still only grabs the first three records... I also rewrote the page to use a Do While... Loop and it grabs all of the records!!! Why is getrows not working the way I think it should? _________ Andrew, The array above is calling for specific records within each row of the recordset... (0,i) would be the first column (0) of the current row (i) - where (1,i) is grabbing the second column (1) from the current row (i) Since this stuff is zero based you have to start with 0 instead of 1... That help? :edit: Oops, forgot that the recordset code wasn' t included above... here it is: dim rsMail,DMtxt,myArray
set rsMail=server.createobject(" ADODB.recordset" )
DMtxt=" Select * From tblMail"
rsMail.open DMtxt, oConn, 3,3,1
if rsMail.EOF then
rsMail.close
set rsMail=nothing
oConn.close
set oConn=nothing
response.write " <p>Error at rsMail.DMProcess</p>"
else
myArray=" "
myArray=rsMail.getrows
rsMail.close
set rsMail=nothing
oConn.close
set oConn=nothing
end if
for i = 0 to uBound(myArray)
DUnsub = " "
DUnsub = request.form(" unsub" ) & " ?dmkey=" & myArray(0,i)
DUnsub = " <a href=' " & DUnsub & " ' >" & DUnsub & " </a>"
DMail = myArray(1,i)
set objMail=server.createobject(" CDONTS.newmail" )
objMail.From=" codeslinger@bdwebservices.com"
objMail.To=DMail
objMail.Subject=" Test From DragonMail"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.Body=DMBody & DUnsub & closeX
' objMail.Send
response.write DMail & " <br>"
set objMail=nothing
next
|
|
|
|