title: how to give combo box itemdata as string value into visual basic 6.0
body: <p>This is the code sample:</p>
  
  <pre><code>Set rs = Nothing
  Set rs = New ADODB.Recordset
  qry = "select maincategoryid,MCategoryName from mainCATEGORY"
  rs.Open qry, Cn, adOpenDynamic, adLockReadOnly
  If rs.EOF = False Then
      Do Until rs.EOF
          maincatddl.AddItem rs!MCategoryName, Val(rs!maincategoryid)
          catddl.ItemData(catddl.NewIndex) = Val(rs!maincategoryid)
          rs.MoveNext
      Loop
  End If
  </code></pre>
  
  <p>It's giving me "error invalid property array index". I have string type main category id.</p>