cancel
Showing results for 
Search instead for 
Did you mean: 

ADO and BW

Former Member
0 Kudos

Hi

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

rstProva.MoveNext

Loop

cnnADO.Close

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Regards

Former Member
0 Kudos

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 & " [0N_PCTR] INCLUDING [0PROFIT_CTR CGT FILIALI].[CGT AREZZO 0HIER_NODE]"

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

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

tks a lot

Answers (0)