Hi All,
I've got a dynamically created XML file which I'm reading in loops. I am trying to put the nodename and value into a 2 dimentional array. As I do not know the number of sibling nodes it may have, I'm trying to redim the array on the fly.
The array is defined as:
Sample code below:
Later on, I'm calling a subroutine to insert/update/delete the values from the associated table, by using the following call:
I am then using the definition in the called subroutine as below:
Here is the problem, at the point where I am trying to redefine the array, if I don't use the preserve option, I lose the data, however, the preserve option gives me the error "Subscript out of range". The values for the array are aryUpdate(1,1) when reading the intl4 variable.
Can some help please. . . .
TIA,
End Sub
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!
I've got a dynamically created XML file which I'm reading in loops. I am trying to put the nodename and value into a 2 dimentional array. As I do not know the number of sibling nodes it may have, I'm trying to redim the array on the fly.
The array is defined as:
Code:
Dim aryUpdate() As String
Sample code below:
Code:
...
If objNodeData.nodeName <> "" Then
ReDim Preserve aryUpdate(intL4, 1)
End If
aryUpdate(intL4, 0) = objNodeData.nodeName
aryUpdate(intL4, 1) = objNodeData.Text
...
Later on, I'm calling a subroutine to insert/update/delete the values from the associated table, by using the following call:
Code:
Call UpdateTableValues(strTableName, strUpdateType, strKeyField, strKeyValue, aryUpdate)
I am then using the definition in the called subroutine as below:
Code:
Sub UpdateTableValues(strTableName As String, strUpdateType As String, strKeyField As String, strKeyValue As String, aryValues() As String)
MsgBox strTableName & vbCrLf & strUpdateType & vbCrLf & strKeyField & vbCrLf & strKeyValue & vbCrLf & aryValues(4, 1)
Here is the problem, at the point where I am trying to redefine the array, if I don't use the preserve option, I lose the data, however, the preserve option gives me the error "Subscript out of range". The values for the array are aryUpdate(1,1) when reading the intl4 variable.
Can some help please. . . .
TIA,
End Sub
Fitz
Did you know, there are 10 types of people in this world:
* Those who understand binary
and
* Those who Don't!!