Hiya!
I have a ActiveX-.dll which contains a function (method) looking a bit like this:
What I want do is pass the contains of the recordset in a multidimensional array.Code:Public Function GetDriversArray() As String If checkDataStore = 1 Then Dim sReturnArray(10,10) As String Dim objConn As New ADODB.Connection Dim objRs As New ADODB.Recordset objConn.Open mvarDataStore objRs.Open "SELECT iId, cName FROM tDrivers ORDER BY cName", objConn If Not (objRs.EOF Or objRs.BOF) Then sReturnArray = objRs.GetRows Else sReturnArray = "" End If objRs.Close objConn.Close Set objConn = Nothing GetDriversArray = sReturnArray End If End Function
The code in the VB app to fetch this (and fill up a combo-box) looks like this:
Its pretty obvoius that the array isnt passed on to the combobox, anyone who knows how to solve this?Code:Dim i As Integer Dim arrDrivers(10,10) As String Dim myObject As New blabla.blabla arrDrivers = myObject.GetDriversArray Set myObject = Nothing cboDrivers1.Clear If IsArray(arrDrivers) Then For i = 0 To UBound(arrDrivers, 1) cboDrivers1.AddItem (arrDrivers(i, 1)) Next End If
Thanks in advance!![]()


Reply With Quote