Could anyone tell me how to pass dynamic variable within the ASP tag. Following is my code:
Error generate at:"<% = ObjRecordSet.Fields.Item(cint(i)).Name %>". It works for :
"<% = ObjRecordSet.Fields.Item(0).Name %>"
"<% = ObjRecordSet.Fields.Item(2).Name %>"
"<% = ObjRecordSet.Fields.Item(3).Name %>"
"<% = ObjRecordSet.Fields.Item(4).Name %>"
and so on.. but will not work at for loop
<script language="VBScript">
Sub onAdd()
Dim FieldNames()
Dim DocRecordFieldCount
Dim i
DocRecordFieldCount = "<% = ObjRecordset.Fields.Count %>"
ReDim FieldNames(DocRecordFieldCount)
for i = 0 to DocRecordFieldCount - 1
FieldNames(i) = "<% = ObjRecordSet.Fields.Item(cint(i)).Name %>"
next
End Sub
</Script>