The following categories are ArrDictionary: Public Class ArrDictionary Private objCollection As New Collection Private objDic As New DictionaryEntry Private strKey, strValue As String Public i As Integer Public Function Item (ByVal Index As Integer) As Object Try Item = objCollection.Item (Index) Catch ex As exception item = "Error, no this!" END TRY END FUNCTION PUBLIC FUNCTION ITEM (BYVAL Key As String) AS Object try = objcollection.item (key) catch exception item = "Error, no this item!" End Try End Function Public Sub Add (ByVal Key As String, ByVal Value As String) objDic.Key = Key objDic.Value = Value objCollection.Add (objDic, objDic.Key) i = 1 End Sub Protected Overrides Sub Finalize () Mybase.Finalize () objcollection = Nothing objdic = Nothing strkey = "" strval = "" i = 0 End Subend Class
The following is a call code segment: DIM ARRSQL AS New ArrDictionary Arrsql.Add ("Researcher", Objexcelsheet.cells (T, 1) .Value) Arrsql.Add ("House Address", Objexcelsheet.cells (T, 2). Value) arrsql.add ("Building Area", Objexcelsheet.cells (t, 3) .Value) Arrsql.add ("Room", Object Ccelsheet.cells (t, 4) .value) arrsql.add ("Down", Objexcelsheet .Cells (t, 5) .value) arrsql.add ("floor", Objexcelsheet.cells (t, 6) .value) arrsql.add ("Production", Objexcelsheet.cells (t, 7) .value) arrsql .Add ("amount", Objexcelsheet.cells (t, 8) .value) arrsql.add ("zone", objexcelsheet.cells (t, 9) .value) arrsql.add ("Completion Date", Objexcelsheet.cells T, 10) .Value) Arrsql.add ("Usage Limits", Object (T, 11) .Value) arrsql.add ("Contact", Objexcelsheet.cells (t, 12) .Value) arrsql.add ("Enter people", objectsheet.cells (t, 13) .value) arrsql.add ("Entry Date", Objexcelsheet.cells (t, 14) .value) Arrsql.add ("Branch", Objexcelsheet.cells (t, 15) .value) 'Combined Field name DIM columnSql AS String' Combined Field Value DIM VALUESQL AS STRING FOR I AS Integer = 1 to arrsql.i columnsql = arrsql .Item (i) .key.toString & "," VALUESQL = "'"