Discussion Board for collaboration related to Creating Analytics for QlikView.
I'm trying to update the value in a stored procedure using a macro, but it's failing to connect to Oracle; my code is:
Dim connection, connectionString, theCommand, commandStringconnectionString = "DSN=EFIN;Uid=user;Pwd=pword;"Set connection = CreateObject("ADODB.Connection")
Set theCommand = CreateObject("ADODB.Command")
If connection.State = adStateOpen Then MsgBox "Welcome to bnhft!"Else MsgBox "Sorry. No bnhft today."End If
const cnstStoredProcedure = 4 'Command type - 4 is for stored procedurecommandString = "PKG_PARAM.SET_FLAG"thecommand.CommandText = commandStringthecommand.CommandType = cnstStoredProcedurethecommand.ActiveConnection = connectionthecommand.Parameters.Append thecommand.CreateParameter("FLAG",adChar,adParamInput,"1")thecommand.Execute
I just get the message "Sorry. No bnhft today." indicating that the connection has failed. The DSN works fine in the reload script?
Any advice welcome!
Do you have System Access turned on in the security section of the module editor?
Yes I have System access set on and local security Allow system access.
Does it work outside of QlikView if you just create a .vbs file and run that?
you're right it doesn't work as a vbs either.....
Not a QV issue then but still I don't see what's wrong with my connection string?
ODBC connection string is different than an OLEDB one. If you want to use the DSN, it might look like this:
"Provider=MSDASQL.1;Password=password;Persist Security Info=True;User ID=userid;Data Source=DSNName"