12-08-2009, 01:26 PM
Hi, I am new in QTP. In MsAccess table , Column Name & data of each coulmn present. Eg. SrNo = 1, Name = Test etc..
How to use array of array to get column name & value .
Here is a code I have written.
**Here is problem : Displayed following error
Type mismatch: 'SrNo'
Function file: C:\DF.qfl
Line (152): " arrRowVal( arrColName(intColumn))= strColumnValue".
Please let me know how to solve the problem.
Thanks in Advance.
Dinesh
How to use array of array to get column name & value .
Here is a code I have written.
Code:
Dim arrRowVal() , arrColName()
FieldsCount = rs.Fields.Count-1 'MsAccess table field count
' stored all column names in array arrColName()
For intColumn = 0 To FieldsCount
ReDim Preserve arrColName(intColumn)
strColumnName = rs.Fields(intColumn).Name
arrColName(intColumn) = Cstr(strColumnName)
MsgBox( "strColumnName : " & arrColName(intColumn))
Next
' store value of column name in arrRowVal
For intColumn = 0 To FieldsCount
ReDim Preserve arrRowVal(intColumn)
strColumnValue = rs.Fields(intColumn).Value
arrRowVal( arrColName(intColumn))= strColumnValue '**Here is problem
Next
**Here is problem : Displayed following error
Type mismatch: 'SrNo'
Function file: C:\DF.qfl
Line (152): " arrRowVal( arrColName(intColumn))= strColumnValue".
Please let me know how to solve the problem.
Thanks in Advance.
Dinesh