Simulating SQL Select Statements

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Simulating SQL Select Statements

    Hi,

    This is my first post. I am an experienced Excel user and programmer (BASIC, PASCAL, DBASE III) but learning Palo and VBA.

    I am need to simulate SQL SELECT statements for an application I am building. I am not able to invoke the Palo API.

    Can someone look at my code and let me know the correct syntax for invoking the Palo API?

    Public Sub PALO_SELECT()
    'This procedure mimics the SQL SELECT statement
    'I have used the Demo database and Sales cube for reference

    'Declare the CUBE access key
    Dim DATABASE As String
    Dim CUBE As String
    Dim PRODUCTS As String
    Dim REGIONS As String
    Dim MONTHS As String
    Dim YEARS As Integer
    Dim DATATYPE As String
    Dim MEASURES As String

    'Assign values to the CUBE access key

    DATABASE = Range("A1")
    CUBE = Range("A2")
    PRODUCTS = Range("A3")
    REGIONS = Range("A4")
    MONTHS = Range("A5")
    YEARS = Range("A6")
    DATATYPE = Range("A7")
    MEASURE = Range("A8")

    '********** HERE IS MY PROBLEM AREA[/COLOR]

    'SELECT Statement starts here

    'Assign Titles
    Range("F1") = "PRODUCTS"
    Range("G1") = "REGIONS"
    Range("H1") = "MONTHS"
    Range("I1") = "YEARS"
    Range("J1") = "DATATYPE"
    Range("K1") = "MEASURE"
    Range("L1") = "VALUE"

    'Assign first row values
    Range("F2") = PRODUCTS
    Range("G2") = REGIONS
    Range("H2") = MONTHS
    Range("I2") = YEARS
    Range("J2") = DATATYPE
    Range("K2") = MEASURE
    'Range("L2") = PALO.DATAC(DATABASE, CUBE, PRODUCTS, REGIONS, MONTHS, YEARS, DATATYPES, MEASURES)
    'Commented out because it won't work without the DLL being active
    Range("L2") = 19

    End Sub

    Thanks,

    David
  • Hi David,

    you can acces palo functions via e.g.
    Range("L2") = Application.Run("PALO.DATA",DATABASE, CUBE, PRODUCTS, REGIONS, MONTHS, YEARS, DATATYPES, MEASURES)

    Don't use PALO.DATAC with Aplpication.Run because this is for networktraffic optimization when retrieving a number PALO-cells on a sheet at the same time.


    Hope this helps.

    Greetings from Cologne

    Holger

    The post was edited 1 time, last by h_decker ().