Results 1 to 2 of 2

Thread: Passing multidimensional array from object to VBapp/ASP-page

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2001
    Location
    Sweden - land of the mooses
    Posts
    44

    Question Passing multidimensional array from object to VBapp/ASP-page

    Hiya!

    I have a ActiveX-.dll which contains a function (method) looking a bit like this:

    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
    What I want do is pass the contains of the recordset in a multidimensional array.

    The code in the VB app to fetch this (and fill up a combo-box) looks like 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
    Its pretty obvoius that the array isnt passed on to the combobox, anyone who knows how to solve this?
    Thanks in advance!
    /Hoffe

  2. #2

    Thread Starter
    Member
    Join Date
    Mar 2001
    Location
    Sweden - land of the mooses
    Posts
    44

    Talking SOLVED!

    Thanks anyway!
    /Hoffe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width