title: Displaying data in Listbox in VB
body: <p>I want display data from database in Listbox...Here is my code, It is not working. In Listbox it is displaying as Object[,].Array.....What can i do... </p>
  
  <p>Dim DBCONSRT, QRYSTR As String</p>
  
  <pre><code>    Dim strSQL As String
  
      Dim DBCON, myConn, myCommand, rs As Object
  
      Dim NoOfRecords As Long
  
      rs = CreateObject("ADODB.Recordset")
  
      Const DB_CONNECT_STRING = "Provider=MSDASQL.1;Persist Security Info=False;User ID=cpa5k;Data Source=NP1;DSN=NP1;UID=user;PASSWORD=pass;SDSN=Default;HST=ibslnpb1.sysplex.homedepot.com;PRT=4101;Initial Catalog=QA1MM;"
  
      myConn = CreateObject("ADODB.Connection")
      myCommand = CreateObject("ADODB.Command")
      myConn.Open(DB_CONNECT_STRING)
      myCommand.ActiveConnection = myConn
      strSQL = "select * from QA1MM.STRSK_OH with ur;"
      rs.Open(strSQL, myConn)
      ListBox1.Items.Add(rs.GetRows(2))
      myConn.Close()
  </code></pre>