Rexolio
Technical User
- Aug 29, 2001
- 230
Below is the actual script I am using. I keep getting a Subscript error.
sqlstr = "SELECT * FROM my_table WHERE inputdate = " & sInDate
Set rs = Conn.Execute(sqlstr)
If rs.EOF Then
booData = False
Else
booData = True
arrNames = rs.GetRows()
for i = 0 to ubound(arrnames,2)
if i mod 3 = 0 then
output = Arrnames(1,i) & vbtab & Arrnames(1,i+1) & vbtab & Arrnames(1,i+2) <-- error on this line
output = output & Arrnames(2,i) & vbtab & Arrnames(2,i+1) & vbtab & Arrnames(2,i+2)
output = ...and on until the last field
elseif (i + 1) mod 3 = 0 then
output = Arrnames(1,i)
output = output & Arrnames(2,i)
output = ...and on
else
output = Arrnames(1,i) & vbtab & Arrnames(1,i+1)
output = output & Arrnames(2,i) & vbtab & Arrnames(2,i+1)
output = ...and on
end if
next
end if
I'm getting a Subscript out of range: '[number: 47]' on the very first line that begins with "output". 47 is the number of records for the specified criteria in my database. The only thing I haven't entered here is:
1 = name
2 = address
3 = city
that someone told be to do. I've tried a couple of different placements and variations of this, but I get errors on those lines. HELP!
sqlstr = "SELECT * FROM my_table WHERE inputdate = " & sInDate
Set rs = Conn.Execute(sqlstr)
If rs.EOF Then
booData = False
Else
booData = True
arrNames = rs.GetRows()
for i = 0 to ubound(arrnames,2)
if i mod 3 = 0 then
output = Arrnames(1,i) & vbtab & Arrnames(1,i+1) & vbtab & Arrnames(1,i+2) <-- error on this line
output = output & Arrnames(2,i) & vbtab & Arrnames(2,i+1) & vbtab & Arrnames(2,i+2)
output = ...and on until the last field
elseif (i + 1) mod 3 = 0 then
output = Arrnames(1,i)
output = output & Arrnames(2,i)
output = ...and on
else
output = Arrnames(1,i) & vbtab & Arrnames(1,i+1)
output = output & Arrnames(2,i) & vbtab & Arrnames(2,i+1)
output = ...and on
end if
next
end if
I'm getting a Subscript out of range: '[number: 47]' on the very first line that begins with "output". 47 is the number of records for the specified criteria in my database. The only thing I haven't entered here is:
1 = name
2 = address
3 = city
that someone told be to do. I've tried a couple of different placements and variations of this, but I get errors on those lines. HELP!