Skip to Content
author's profile photo Former Member
Former Member

ADO and BW


I made this code :

Dim strstringaconnessione As String

Dim cnnADO As New ADODB.Connection

Dim rstProva As New ADODB.Recordset

Dim cmdProva As New ADODB.Command

strstringaconnessione = "Data Source = SAP BW Test (TBC)"

strstringaconnessione = strstringaconnessione & ";User Id = [user]"

strstringaconnessione = strstringaconnessione & ";Password = [psw];"

'strstringaconnessione = strstringaconnessione & "Provider = " & MDrmSAP

strstringaconnessione = strstringaconnessione & "SFC_CLIENT=150;SFC_LANGUAGE=IT"


' apro il database


If cnnADO.State = adStateClosed Then

cnnADO.Provider = "MDrmSAP"

Call cnnADO.Open(strstringaconnessione)

End If

ADO_ApriConnessione = cnnADO.State

rstProva.Open "SELECT * FROM CE_FXX_PER_DIREZIONE", cnnADO, adOpenForwardOnly, adLockReadOnly

Do Until rstProva.EOF




ADO_ApriConnessione = cnnADO.State

Exit Sub

But when I try to open the recordset I have an error, because the program ask me the variables .

How can I write the variables before opening the query?

Please help me

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2005 at 02:38 PM

    I think that the only way i sto set valuse as default; when you enter variable value there’s a botton after the field; press it and chose personalize variable value.

    After that it will never ask you for the variable and if you want to change the value from bex you have to choose ‘Modify query’ – Change variable values’.

    Hope it helps.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I found the solution in this way:

      strMDX = "SELECT"

      strMDX = strMDX & " [Measures].MEMBERS ON ROWS"

      strMDX = strMDX & " ,NON EMPTY [34293QW91GGT5D4Q6BR94DW76].MEMBERS ON COLUMNS"

      strMDX = strMDX & " FROM [0PCA_C01/CE_FXX_PER_DIREZIONE]"

      strMDX = strMDX & " SAP VARIABLES"


      strMDX = strMDX & " [Z_PERIOD] INCLUDING [0FISCPER].[K42005006]"

      strMDX = strMDX & " [VPIAN] INCLUDING [0VERSION].[001]"

      tks a lot

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.