Results 1 to 7 of 7

Thread: Returning Parameters

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2005
    Posts
    63

    Returning Parameters

    I'm accessing an MS Access 2000 DB through VB6 within a module and I need to return a table's worth of fields (8 or so) back to the form tha is interfacing with the module. Since I'm used to work on VB.NET and need to do this on VB6 I'm completely lost.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Returning Parameters

    Have a search for ADOX...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2005
    Posts
    63

    Re: Returning Parameters

    What is ADOX? I'm using ADODB and all I need to know is how VB6 returns data from functions

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Returning Parameters

    Here is a quicky for you, reference Microsoft ADO 2.something Ext. for DDL and Security...

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim x As ADOX.Catalog
    3.     Dim y As New ADOX.Table
    4.     Set x = New ADOX.Catalog
    5.     x.ActiveConnection = connImport
    6.     Set y = x.Tables("ImpHBL")
    7.     MsgBox y.Columns.Count
    8. End Sub
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2005
    Posts
    63

    Re: Returning Parameters

    If for example I had to have a Sub that generates an array in a module, can't I return that array to the form in anyway? this is what I need

  6. #6
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Returning Parameters

    Subs don't return anything. Although you can use a function in a way similar to this
    VB Code:
    1. Public Function returnArray() As String()
    2.     Dim someArray(10) As String
    3.     Dim i As Integer
    4.     For i = 0 To 9
    5.         someArray(i) = "Value at : " & Str(i)
    6.     Next
    7.     returnArray = someArray
    8. End Function
    9.  
    10. Public Sub main()
    11.     Dim returnedArray() As String
    12.     returnedArray = returnArray
    13. End Sub

  7. #7

    Thread Starter
    Member
    Join Date
    Dec 2005
    Posts
    63

    Re: Returning Parameters

    Thanks a lot my friend

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