Consulting

Results 1 to 3 of 3

Thread: Want to convert vb.net code to Excel vba

  1. #1
    VBAX Newbie
    Joined
    Apr 2013
    Posts
    1
    Location

    Want to convert vb.net code to Excel vba

    Want to convert following code to excel vba.
    I get error on

    Dim idoDataSet As dataset - saying invalid data type





    Dim sessionToken As String
    Dim idoDataSet As dataset

    Dim idoWS As New clsws_IDOWebService
    sessionToken = idoWS.CreateSessionToken("user", "password", "dev1_phil")
    idows.wsm_LoadDataSet(sessionToken, "SLCustomers", "Name, CustNum, CustSeq", "", "", "", 0)
    idoDataSet = idoWS.LoadDataSet(sessionToken, "SLCustomers", "Name, CustNum, CustSeq", "", "", "", 0)
    DataGridView1.DataMember = idoDataSet.Tables(0).TableName
    DataGridView1.DataSource = idoDataSet


  2. #2
    VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    This is from my version of MS Access Help

    Using ADO with ADO MD

    ADO and ADO MD are related but separate object models. ADO provides objects for connecting to data sources, executing commands, retrieving tabular data and schema metadata in a tabular format, and viewing provider error information. ADO MD provides objects for retrieving multidimensional data and viewing multidimensional schema metadata.
    When working with an MDP you may choose to use ADO, ADO MD, or both with your application. By referencing both libraries within your project, you will have full access to the functionality provided by your MDP.
    It is often useful for consumers to get a flattened, tabular view of a multidimensional dataset. You can do this by using the ADO Recordset object. Specify the source for your Cellset as the Source parameter for the Open method of a Recordset, rather than as the source for an ADO MD Cellset.
    It may also be useful to view the schema metadata in a tabular view rather than as a hierarchy of objects. The ADO OpenSchema method on the Connection object allows the user to open a Recordset containing schema information. The QueryType parameter of the OpenSchema method has several SchemaEnum values that relate specifically to MDPs. These values are:
    • adSchemaCubes
    • adSchemaDimensions
    • adSchemaHierarchies
    • adSchemaLevels
    • adSchemaMeasures
    • adSchemaMembers
    To use ADO enum values with ADO MD properties or methods, your project must reference both the ADO and ADO MD libraries. For example, you can use the ADO adState enum values with the ADO MD State property. For more information about establishing references to libraries, see the documentation of your development tool.
    For more information about the ADO objects and methods, see the ADO API Reference.
    See Also

    ADO MD Object Model | Microsoft ADO MD Programmer's Reference | Overview of Multidimensional Schemas and Data | Programming with ADO MD | Working with Multidimensional Data



    This line of your code[VBA]Dim idoWS As New clsws_IDOWebService[/VBA]Tells me that there is another code module that you haven't shown us.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by skb
    Want to convert following code to excel vba.
    I get error on

    Dim idoDataSet As dataset - saying invalid data type

    I don't think it is possible as you are mixing COM and .NET

    http://social.msdn.microsoft.com/for...-4de79643d185/

    The code you posted appears to reference a web service. Is there an API documentation for that web service; if so you can probably use VBA via an HTTP GET. Just .02

    Stan

Posting Permissions

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